2025-01-28 08:47 PM - edited 2025-01-28 08:53 PM
Hi All,
I am facing a strange issue with the STM32H7S78-DK.I am using STM32CubeIDE for all of these tests (Version: 1.17.0, Build: 23558_20241125_2245 (UTC)) and of course STM32CubeMX (Version: 6.13.0-RC5 Build: 20241122-0809 (UTC)).
Basically when using a STM32CubeMX generated project with default peripherals, HAL_SD_Init fails. The root issue is that HAL_SD_Init -> HAL_SD_InitCard -> SD_PowerON -> SDMMC_CmdGoIdleState -> SDMMC_GetCmdError times out.
After a lot of confusion and testing I figured out that this issue seems to be linked to using a freshly generated STM32CubeMX project for the board in which you select "Initialize all peripherals with their default Mode", although this isn't always the case. Here's what I have tested and the results:
If I generate a project using STM32CubeMX with only the Appli project, select NO to "Initialize all peripherals with their default Mode?" and then go through the process documented here on GitHub and I use the Boot_XIP.hex provided, everything works fine.
If I generate a project using STM32CubeMX with only the Appli project, select YES to "Initialize all peripherals with their default Mode?" and then go through the process documented here on GitHub and I use the Boot_XIP.hex provided, everything breaks and it gets stuck at an address of 0x700003d0 with no debug info available.
If I generate a project using STM32CubeMX with both a Boot and Appli projects, select NO to "Initialize all peripherals with their default Mode?" and then manually go in, enable XSPI1, XSPI2, RCC and SDMMC1 (adjusting settings in XSPI1 and XSPI2 to be correct), it times out as explained above.
If I generate a project using STM32CubeMX with both a Boot and Appli projects, select YES to "Initialize all peripherals with their default Mode?" it times out as explained above.
I am utterly lost as to what to try and look into next. My suspicion is its something to do with how the clock is set up in the Boot app as there is no clock provided to the SD card in any of the cases when it times out.
Any help would be much appreciated!