Skip to main content
Vivek Patel
Visitor II
July 29, 2020
Solved

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

  • July 29, 2020
  • 2 replies
  • 862 views

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

This topic has been closed for replies.

2 replies

KnarfB
KnarfBBest answer
Super User
July 29, 2020
gregstm
Senior II
July 29, 2020

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