Skip to main content
Graduate II
March 5, 2024
Solved

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

  • March 5, 2024
  • 1 reply
  • 1180 views

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?

    This topic has been closed for replies.
    Best answer by CTapp.1

    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.

    1 reply

    CTapp.1AuthorAnswer
    Graduate II
    March 5, 2024

    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.