2025-04-24 5:47 AM
Hello,
I stumbled upon a cubemx generation issue for sdmmc2 for the stm32u5g9zjt6q (I didn't have this issue with some other stm32u5xx).
For a basic cubemx configuration of sdmmc2, the HAL_SD_MspInit is wrongly generated. It is a bit annoying as I have to manually edit the file for each code generation or create my own overload function (not a huge effort I concede).
In the Src/stm32u5xx_hal_msp.c, void HAL_SD_MspInit(SD_HandleTypeDef* hsd) calls
__HAL_RCC_SDMMC1_CLK_ENABLE();
instead of
__HAL_RCC_SDMMC2_CLK_ENABLE();
Same for void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd) with the __HAL_RCC_SDMMC1_CLK_DISABLE()
I might be the only one to experience it but I put it here just in case.
Solved! Go to Solution.
2025-04-24 5:59 AM
Known issue:
Solved: Bug report. STM32U5 enabling SDMMC2 turns on the c... - STMicroelectronics Community
2025-04-24 5:49 AM
I forgot to mention that I use:
- STM32CUBEIDE 1.17.0
- STM32CUBEMX 6.13.0
2025-04-24 5:59 AM
Known issue:
Solved: Bug report. STM32U5 enabling SDMMC2 turns on the c... - STMicroelectronics Community