Skip to content

Commit dbeab29

Browse files
committed
fix for sdioio module IO errors
1 parent 14e2f55 commit dbeab29

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
145145
self->handle.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
146146
self->handle.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
147147
self->handle.Init.BusWide = SDMMC_BUS_WIDE_1B;
148-
self->handle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
148+
// For the SDMMC controller Hardware Flow Control needs to be enabled
149+
// at the default speed of 25MHz, in order to avoid FIFO underrun (TX mode)
150+
// and overrun (RX mode) errors.
151+
self->handle.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_ENABLE;
149152
self->handle.Instance = SDMMCx;
150153
#else
151154
__HAL_RCC_SDIO_CLK_ENABLE();

0 commit comments

Comments
 (0)