cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX wrong generation of HAL_SD_MspInit for SDMMC2 STM32U5G9ZJT6Q

gorgabab
Associate II

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Known issue:

Solved: Bug report. STM32U5 enabling SDMMC2 turns on the c... - STMicroelectronics Community

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
gorgabab
Associate II

I forgot to mention that I use:

 - STM32CUBEIDE 1.17.0

 - STM32CUBEMX 6.13.0

TDK
Guru

Known issue:

Solved: Bug report. STM32U5 enabling SDMMC2 turns on the c... - STMicroelectronics Community

If you feel a post has answered your question, please click "Accept as Solution".