cancel
Showing results for 
Search instead for 
Did you mean: 

With the command length unknown, is there a documented way to use DMA?

Vivek Patel
Associate

I have unknown length of data to be received on UART, and It is continuous bulk of data so which is the better way to use UART, I have configured it with DMA but It is accepting defined bytes only.

Could you provide best solution which is good for this task?

Regards,

Vivek Patel

1 ACCEPTED SOLUTION
2 REPLIES 2
gregstm
Senior III

if it was me, I would use the simple approach of using a receive interrupt to fill a circular buffer. When all is working fine, then try using a circular DMA buffer only if extra efficiency is required. Never tried it, but I would try using DMA_CNDTR to calculate an "in_ptr" to compare with a user updated "out_ptr" to check/poll if data is available. I would make the buffer very large to avoid any chance of the buffer data being overwritten/overrun