2017-07-31 01:35 PM
In STM32Cube_FW_F7_V1.7.0/Projects/STM32746G-Discovery/Examples/SPI/SPI_FullDuplex_ComDMA example shows a simple DMA transfer with data cache on.
How can aRxBuffer buffer can be updated correctly without a region defined non-cacheable?
Solved! Go to Solution.
2017-08-01 05:28 AM
Allocate your receive buffers such that they're on a cache line boundary and extend an integral number of cache lines. In the DMA completion call SCB_InvalidateDCache_by_Addr() before expecting the data to be valid.
2017-08-01 05:28 AM
Allocate your receive buffers such that they're on a cache line boundary and extend an integral number of cache lines. In the DMA completion call SCB_InvalidateDCache_by_Addr() before expecting the data to be valid.
2017-08-01 06:07 AM
After looking at the code more, the reason why this works once is aRxBuffer is not in the data cache since it has not been read. I would hope the examples for the F7/H7 would be updated to reflect cache issues, not just 'lucky' code,
2017-08-01 10:47 AM
Well, hope but don't count on it. Treat all example code as just that: a very specific, narrow example. Once you incorporate any example code you own it...and its 'luck'. ;)