2019-12-11 01:35 PM
Hello,
This is for the STM32H7, but may be applicable to other STM32 chips.
Is there a way to do a continuous DMA stream from a UART without requiring an expected size?
I would like to be able to set up a receive buffer with DMA in circular mode, and just say "give me infinite data" and have it continuously write data to the circular buffer. I'll handle the reading and parsing on my own as the data is written.
Is this possible to configure the DMA to do?
Thank you.
2019-12-11 04:42 PM
Yes. Start it in circular mode. It writes continuously as data comes in, without CPU intervention. Poll the NDTR register to find the current location.
2019-12-12 06:00 AM
Yes. On the H7, where there are a couple of different DMA controllers, use the "normal" DMA1 or DMA2, not BDMA nor MDMA. The memory buffer should be allocated in AXI SRAM when processed by the M7 core, or in AHB SRAM{1,2,3} when processed by the M4 core.
2019-12-12 09:34 AM
Thank you: I had it configured this way, but was missing the first data set after the buffer was wrapping. It turns out I had a bug in my cache invalidation and it all works now!