Post Go back to editing

UART Data transfer using DMA

Dear Sir,

Please provide me an example code in C for the above requirement. When I'm modifying the UART echo example for core interrupt to DMA interrupt during linking it shows error in IDDE as fatal error : Link failed and The following symbols referenced in processor "P0" could not be resolved: 'length[_length]' referenced from '.\Debug\UARTDMA transfer.doj'

please help in this regard as soon as possible.

regards

satya

  • Hi jeyanthi,

    Your code works fine for UART data transfer using DMA. since in your code in SRU programming you have connected UART TX O to UART RX I this routes whatever transmitted will be received in straight path.

    but, When I try to use DPI 9 and DPI10 pins for UART TX and RX for data transfer and receive, I'm facing problem in receiving. please provide solution as early as possible and code is already placed you can see it in second mail tag.

    please provide the solution as soon as possible.

    regards

    satya

  • Hi Satya,

               I had modified the code to add the UART signals to the DPI pins 9 and 10. I have connected them externally using a wire on P2 header(31 and 32). This code works fine. You can try this one.

    Regards,

    Jeyanthi

  • Hi Satya,

            The major difference between the core mode and DMA mode is that in core mode the core does the data transfers. For DMA mode, the DMA controller takes care of this. For more details please refer the HRM.

    I would suggest you to use the DMA mode of operation with chaining enabled in case of continuous transfers. This will interrupt the core in a minimal way and the core can do some other activity in parallel.

    Best Regards,

    Jeyanthi

  • Hi jeyanthi,

    Your code works fine, Thanks for your support.

    please let me know the difference between core transfer and DMA transfer, since what I observed in both transfers is In core transfer: core does polling to transfer data and senses the UART buffer whether full or empty, once full it transfers. In DMA transfer: No polling to transfer data and dumps data.

    please clarify me as soon as possible.

    please suggest me which one I have to choose. In my project where data transfer is critical means data loss should be minimal and processor handles other tasks too, so that processor cannot be engaged dedicatedly.

    regards

    satya

  • Hi Satya,

               In DMA mode of operation, the DMA controller takes care of checking the buffer status and writing /reading the data. The core need not have to do this. Once the number of data is received/transmitted then the DMA controller generates an interrupt to the core. The core needs to service the interrupt. Inside the interrupt service routine, the core can process the data received.

    Best Regards,

    Jeyanthi

  • Hi jeyanthi,

    In DMA mode of operation can we use the core registers for checking the buffer status and by make use of those registers can we transfer the data. It is just like core transfer in DMA mode.

    regards

    satya

  • Hi jeyanthi,

    thanks for your explanation it clarifies me. Why I have got this doubt since when I'm trying your code to data transfer with PC hyper terminal, its not working. I want to duplicate UART echo back example which does data transfer with PC in core mode, same way I'm trying for in DMA mode.

    Please help me in this regard as soon as possible.

    regards

    satya 

  • Hi Satya,

                The UART echo back example code uses core mode operation because each data word received from PC should be sent back immediately. Using the DMA mode may not be a good idea for this case. If you want to use DMA mode then you may need to send one set of data from the PC end. On the DSP end receive all of them in DMA mode and send them back.

    Best Regards,

    Jeyanthi

  • Hi Jeyanthi,

    Thanks for your explanation, As you said to implement the echo back example in DMA mode needs to send a set of data from PC end and receive from the DSP end. But I tried this in my code but it is not receiving full set of data, so please help me in this regard as soon as possible.

    regards

    satya

  • Hi Satya,

               What is happening in your code? How many words are sent from PC end? How many are received by the processor? Do you see any error conditions set on the UART status registers? Can you share the code you modified?

    Regards,

    Jeyanthi