cancel
Showing results for 
Search instead for 
Did you mean: 

SD-Card not working with STM32H7B3I-DK when D-Cache is enabled

CTapp.1
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions
CTapp.1
Senior

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.

View solution in original post

1 REPLY 1
CTapp.1
Senior

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.