2025-02-04 02:18 AM - last edited on 2025-02-11 02:31 AM by Andrew Neil
Hello everybody.
I bought Riverdi STM32 Embedded Display RVT121HVSNWC00-B
I create my first project using touch GFX.
I generate code and import it in STM32CubeIDE.
I format FAT32 a 128G uSD using custom program.
I plug the uSD into adapter and I write this code.
fresult is FS_NOT_READY and I don't understand the reason.
Here my configuration.
I notice in the main that there is FATFS initialization
but I don't find a call to MX_SDMMC1_SD_Init.
If I force this call after FATFS initlization the code run in ErrorHandler, but if I inpect hsd1.SdCard struct I see that card property are read correctly (I believe).
BlockSize x BlockNbr = 128G !! OK
Can someone help me ?
Thanks in advice
Solved! Go to Solution.
2025-02-11 02:25 AM - last edited on 2025-02-11 02:30 AM by Andrew Neil
Now I can use uSD with this modification.
It's my first time for STM32H757 (and first ST time) so I honestly say that I don't know why it works.
1. Replace 0x00 with SD_PRESENT line 297 in bsp_driver_sd.c
2. Enable SDMMC1 global interrupt
3. Set SDMMC clock divide factor to 4
4. Disable CPU DCache
5. Enable this defines in /CM7/FATFS/Target/sd_diskio.c
With this modifications mount, read and write to uSD work.
I would want to lay the CPU DCache Enabled because to being not enabled let me lose computation power.
If someone has some suggestion I will appreciate.
2025-02-05 12:01 AM - last edited on 2025-02-11 02:30 AM by Andrew Neil
If I could help ...
I inspect the code step By step and I notice that my SD card is CARD_V2_X and that code seems go properly until it reaches this instruction in stm32h7xx_hal_sd.c
error state is 4 (HAL_SD_ERROR_CMD_RSP_TIMEOUT) that is different from HAL_SD_ERROR_NONE and so it returns UNSUPPORTED_FEATURE.
Here the stack
2025-02-05 12:29 AM - last edited on 2025-02-11 02:31 AM by Andrew Neil
I inspect SDMMC_CmdAppCommand ... I've tried to add some HAL_Delay (commented Mauro Fantina) but the problem still remain
2025-02-11 02:25 AM - last edited on 2025-02-11 02:30 AM by Andrew Neil
Now I can use uSD with this modification.
It's my first time for STM32H757 (and first ST time) so I honestly say that I don't know why it works.
1. Replace 0x00 with SD_PRESENT line 297 in bsp_driver_sd.c
2. Enable SDMMC1 global interrupt
3. Set SDMMC clock divide factor to 4
4. Disable CPU DCache
5. Enable this defines in /CM7/FATFS/Target/sd_diskio.c
With this modifications mount, read and write to uSD work.
I would want to lay the CPU DCache Enabled because to being not enabled let me lose computation power.
If someone has some suggestion I will appreciate.