@@ -242,7 +242,13 @@ int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t sta
242242 wait_write_complete (self );
243243 self -> state_programming = true;
244244 common_hal_mcu_disable_interrupts ();
245- HAL_StatusTypeDef r = HAL_SD_WriteBlocks (& self -> handle , bufinfo -> buf , start_block , bufinfo -> len / 512 , 1000 );
245+ #ifdef STM32H750xx
246+ // longer timeouts needed because code executing from QSPI is slower
247+ uint32_t time_out = SDMMC_DATATIMEOUT ;
248+ #else
249+ uint32_t time_out = 1000 ;
250+ #endif
251+ HAL_StatusTypeDef r = HAL_SD_WriteBlocks (& self -> handle , bufinfo -> buf , start_block , bufinfo -> len / 512 , time_out );
246252 common_hal_mcu_enable_interrupts ();
247253 if (r != HAL_OK ) {
248254 return - EIO ;
@@ -255,7 +261,13 @@ int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t star
255261 check_whole_block (bufinfo );
256262 wait_write_complete (self );
257263 common_hal_mcu_disable_interrupts ();
258- HAL_StatusTypeDef r = HAL_SD_ReadBlocks (& self -> handle , bufinfo -> buf , start_block , bufinfo -> len / 512 , 1000 );
264+ #ifdef STM32H750xx
265+ // longer timeouts needed because code executing from QSPI is slower
266+ uint32_t time_out = SDMMC_DATATIMEOUT ;
267+ #else
268+ uint32_t time_out = 1000 ;
269+ #endif
270+ HAL_StatusTypeDef r = HAL_SD_ReadBlocks (& self -> handle , bufinfo -> buf , start_block , bufinfo -> len / 512 , time_out );
259271 common_hal_mcu_enable_interrupts ();
260272 if (r != HAL_OK ) {
261273 return - EIO ;
0 commit comments