Skip to content

Commit b33f108

Browse files
committed
stm32/sdcard: Properly reset SD periph when SDMMC2 is used on H7 MCUs.
1 parent c932639 commit b33f108

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/stm32/sdcard.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,14 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
169169

170170
#if defined(STM32H7)
171171
// Reset SDMMC
172+
#if defined(MICROPY_HW_SDMMC2_CK)
173+
__HAL_RCC_SDMMC2_FORCE_RESET();
174+
__HAL_RCC_SDMMC2_RELEASE_RESET();
175+
#else
172176
__HAL_RCC_SDMMC1_FORCE_RESET();
173177
__HAL_RCC_SDMMC1_RELEASE_RESET();
174178
#endif
179+
#endif
175180

176181
// NVIC configuration for SDIO interrupts
177182
NVIC_SetPriority(SDMMC_IRQn, IRQ_PRI_SDIO);

0 commit comments

Comments
 (0)