Read from UART in Dma-mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RoKl_290166
Level 4
Level 4
Welcome!

Hi,

   

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?

   

 

   

regards!

0 Likes
3 Replies
Anonymous
Not applicable

Hi,

   


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.

Regards,
Steve

0 Likes
RoKl_290166
Level 4
Level 4
Welcome!

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,

   

Robert

0 Likes
RoKl_290166
Level 4
Level 4
Welcome!

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

0 Likes