2020-02-13 09:06 AM
I'd like to setup a SPI/DMA to read data from a magnetometer such that the new data is saved to memory without any CPU intervention. I understand a timer could be used, but I don't want any gap between when one spi read and the next. The CPU could then read the latest value from memory any time.
Solved! Go to Solution.
2020-02-13 12:26 PM
Use circular DMA.
I'm not sure whether Cube had any native method to avoid callbacks, I don't Cube, but generally it's just disabling the DMA interrupts.
JW
2020-02-13 12:26 PM
Use circular DMA.
I'm not sure whether Cube had any native method to avoid callbacks, I don't Cube, but generally it's just disabling the DMA interrupts.
JW
2020-02-13 09:27 PM
Thanks, ciruclar mode has a sub-option of "double buffer"... do you know if this is because regular circular mode may lead to a race condition where the DMA is updating the memory at the same time the CPU is reading from it? If not, when is double buffer mode needed?
2020-02-13 11:55 PM
No, in both cases the processor had to cope with the same data rate. Double-buffer mode has a relatively rare true usage on the the fact that it allows to change the memory-side address of the currently inactive buffer.
JW
2020-02-15 06:11 PM
Sounds like if one needs to ping-pong between transmitting different data then the double buffer mode would be the way go.. but I think circular mode will work fine for my application. Thanks!