Skip to main content
Graduate II
October 13, 2025
Solved

Stm32h747-Disco sd card using FatFs works on M7 core and not on CM4

  • October 13, 2025
  • 2 replies
  • 508 views

 

Hi everyone,

I’m currently working with an STM32H747 and trying to perform SD card write operations using core M4. The SMMC1 peripheral is connected to the D1 domain, which (as far as I understand) means that the M4 core (D2 domain) doesn’t have direct access to it.

When I try to write to the SD card from M4 (using MDMA), it always fails — f_mkfs returns an error. However, when I run exactly the same code on core M7, everything works perfectly fine.

So my questions are:

Does it make sense that the M4 cannot access SMMC1 because of the D1 domain connection?

Is there any way to make SD write operations work from the M4 core (for example, through shared memory, DMA Settings, or another workaround)?

Thanks in advance.

    This topic has been closed for replies.
    Best answer by Patryk_Kucia

    Long night..... but IT WORKED !!!

    with only one line changed

     

    FRESULT res; /* FatFs function common result code */
    __attribute__((section(".RAM_D1"))) uint32_t byteswritten, bytesread; /* File write/read counts */
    uint8_t wtext[] = "STM32 FATFS works great!"; /* File write buffer */
    __attribute__((section(".RAM_D1"))) uint8_t rtext[_MAX_SS];/* File read buffer */

     

    IDK why i putted write buffer to D1 but now its ok!

    2 replies

    Technical Moderator
    October 13, 2025

    Hello @Patryk_Kucia 

    You are right, the SDMMC1 peripheral is located within the D1 domain of the STM32H747, which means it is not directly accessible by the D2 domain (Cortex-M4 core). As a result, the Cortex-M4 core cannot perform SD card operations using SDMMC1. To enable SD card access from the Cortex-M4 core, we recommend utilizing the SDMMC2 peripheral, which is mapped to the D2 domain and can be directly controlled by the Cortex-M4.

    Graduate II
    October 13, 2025

    Yes but in STM32H747-Disco it is connected to SDMMC1 not SDMMC2 and they have different pinout. Unless I can change the mapping so that SDMMC2 will have pins from SDMMC1???

    Technical Moderator
    October 13, 2025

    Hello,

    See also this thread: STM32H757 SDMMC1 only works with M7 core

     

    Graduate II
    October 13, 2025

    So it is possible but how? Saket_Om just said that it is not posible and in your link it just works from changing the clock?