2019-07-26 02:08 AM
I'm using STM32F429 and trying to use HAL library to communicate to SPI slave via DMA channel.
I'd like to ask how is resolved problem with for example sending data to SPI via DMA? Is there any kind of synchronization between SPI and DMA to disallow overwritting SPI DATA register by DMA when SPI is sending previous SPI DATA register? In other words - how DMA knows how fast it should move data from source buffer to SPI DATA register to not overwrite its contents?
Is there any synchronization protocol which tells DMA to stop transmitting to SPI DATA register because SPI is currently busy with transmitting previous SPI DATA register?
Solved! Go to Solution.
2019-07-26 02:38 AM
The DMA is triggered byte the SPI TXE flag, the DR holding register is separate from the internal shift register that puts the data on the wire.
2019-07-26 02:37 AM
The DMAs on STM32 microcontrollers can generate two interruptions: HalfTransfer and TransferComplete.
You can use the latter to know when the data is sent and start sending new data.
2019-07-26 02:38 AM
The DMA is triggered byte the SPI TXE flag, the DR holding register is separate from the internal shift register that puts the data on the wire.
2019-07-26 02:47 AM
Thank you for rapid answer.