Skip to content

Commit 81c7665

Browse files
committed
sdioio support work in progress
1 parent e871e7d commit 81c7665

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ports/stm/boards/daisy_seed_with_sdram/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ MCU_PACKAGE = UFBGA176
1313
LD_COMMON = boards/common_tcm.ld
1414
LD_FILE = boards/STM32H750.ld
1515

16-
CIRCUITPY_SDIOIO = 1
16+
CIRCUITPY_SDIOIO = 0

ports/stm/common-hal/sdioio/SDCard.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
133133
HAL_GPIO_Init(pin_port(clock->port), &GPIO_InitStruct);
134134

135135
#ifdef STM32H750xx
136+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
137+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SDMMC;
138+
PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL;
139+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
140+
mp_raise_ValueError_varg(MP_ERROR_TEXT("MMC/SDIO Clock Error %x"));
141+
}
136142
__HAL_RCC_SDMMC1_CLK_ENABLE();
137143

138144
self->handle.Init.ClockDiv = SDMMC_NSPEED_CLK_DIV;

0 commit comments

Comments
 (0)