2024-03-05 06:46 AM
I'm trying to use the SD-Card on the STM32H7B3I-DK with FatFS, but the transfers from the card do not work if the D-Cache is enabled.
There are a number of other posts that report similar with this one looking most similar (and has a solution).
I have enabled cache management and the scratch buffer:
#define ENABLE_SD_DMA_CACHE_MAINTENANCE 1
#define ENABLE_SCRATCH_BUFFER
However, the card still does not work if I enable the D-Cache.
What else do I need to look at?
Solved! Go to Solution.
2024-03-05 09:21 AM
Looks like I don't need to use the scratch buffer, but I did need to change the memory protection so that the region was "write-through".
This is mentioned in the thread I referenced, but it took a while to work out that the setting was System Core / CORTEX_M7 / Bufferable Permission - reading the reference manual for the M7 (PM0253) got me there in the end.
2024-03-05 09:21 AM
Looks like I don't need to use the scratch buffer, but I did need to change the memory protection so that the region was "write-through".
This is mentioned in the thread I referenced, but it took a while to work out that the setting was System Core / CORTEX_M7 / Bufferable Permission - reading the reference manual for the M7 (PM0253) got me there in the end.