3 Replies Latest reply on May 10, 2012 3:18 AM by RoKl_290166

    Read from UART in Dma-mode




      I want to read from the FX3's UART which is configured in DMA-mode. The according DMA-channel is set to Manual_In between the UART-producer and the CPU as the consumer.


      I connected a serial cable between the FX3 eval-board and my PC.


      In the firmware I use the function CyU3PDmaChannelGetBuffer() to read from the DMA-channel. On PC-side I use a simple console-program to type some signs and send it to serial-port.


      Unfortunately I can't receive anything in the FX3 via the UART DMA in-channel, means I can't see any activity on UART_RX-pin of the eval-board!


      Transmitting data from FX3 to PC via another UART DMA out-channel works fine!


      Did anybody implemented a thing like this successfully? Where could be the failure?


      Do I receive the DMA-buffer only if it's full or which event must happen that the CyU3PDmaChannelGetBuffer() returns w/ the received data?





        • 1. Re: Read from UART in Dma-mode



          I'm assuming you set rxEnable to CyTrue when calling CyU3PUartSetConfig()?
          Are you calling CyU3PUartRxSetBlockXfer()?

          I would expect the RX direction to have difficulty telling when DMA operations are supposed to be marked complete. You may need to send fixed-length "packets", or switch to byte-by-byte mode.


          • 2. Re: Read from UART in Dma-mode

            Hi Steve,


            yes, I set rxEnable of the struct CyU3PUartConfig_t to true and call CyU3PUartRxSetBlockXfer(0xFFFFFFFF)!


            Yes, possibly I have to use the Byte-mode instead of DMA.


            But anyhow I don't receive anything even if I type more signs than the DMA buffer-size has (32 bytes in my case) so that the buffer must be full and could be retrieved by getBuffer()-function?! So at least this should work somehow...?!




            Best regards,



            • 3. Re: Read from UART in Dma-mode

              Problem solved! My serial cable has a defect on the according pin.