Question
STM32F4 DMA Address Update penalty with double buffering
So the background is essentially this -
- I am trying to use one of the streams of STM32F4 DMA2 in circular, DBM mode.
- The DMA stream is being used to move data out of the SPI DR register at regular intervals, as soon as data becomes available at SPI RX (the dma stream and channel respond to the SPI RX dma requests).
- In DMA transaction complete callback, I am updating the M0 base address (which is allowed because in DBM mode, the DMA would switch to the memory region defined by M1).
I however see some SPI data being missed/skipped right after the first NDTR data.
Things I have tried -
- Reducing the rate at which SPI is receiving data. (Brought it down from 1MSPS to 10KSPS).
- I still see discontinuities right after NDTR data.
- Modifying the transaction complete callback to a) return directly b) do some dummy operation on a different DMA2 stream and then return.
- In both cases I don't see any discontinuities at the NDTR mark.
- This leads me to conclude that writing to the M0AR incurs a time penalty where the DMA stream doesn't work?

(Figure showing the discontinuity)
My question is essentially whether this is documented behaviour, and if so, whether there's some heuristics available on the time penalty.
Any leads/pointers would be very helpful!
Thanks
