Is there any way to change HAL's SDMMC_DATATIMEOUT?
My system has a user-removeable SD Card. If there is a problem with the card at initialization time, the system gets stuck looping in
SD_FindSCR() at stm32l4xx_hal_sd.c:3,970 0x8039632
SD_WideBus_Enable() at stm32l4xx_hal_sd.c:3,822 0x803947a
HAL_SD_ConfigWideBusOperation() at stm32l4xx_hal_sd.c:2,643 0x8038db0
BSP_SD_Init() at sd_diskio.c:190 0x8025d18
SD_initialize() at sd_diskio.c:225 0x8025da4 specifically here:
while(!__HAL_SD_GET_FLAG(hsd, SDMMC_FLAG_RXOVERR | SDMMC_FLAG_DCRCFAIL | SDMMC_FLAG_DTIMEOUT | SDMMC_FLAG_DBCKEND))
{
if(__HAL_SD_GET_FLAG(hsd, SDMMC_FLAG_RXDAVL))
{
*(tempscr + index) = SDMMC_ReadFIFO(hsd->Instance);
index++;
}
if((HAL_GetTick() - tickstart) >= SDMMC_DATATIMEOUT)
{
return HAL_SD_ERROR_TIMEOUT;
}
}Is there any way to override the
#define SDMMC_DATATIMEOUT ((uint32_t)0xFFFFFFFFU)in stm32l4xx_ll_sdmmc.h?
I'd rather not edit the code generated by SMT32CubeIDE.
STM32CubeIDE
Version: 1.11.0
Build: 13638_20221122_1308 (UTC)
Board Name NUCLEO-L4A6ZG
Generated with: STM32CubeMX 6.5.0
MCU Series STM32L4
MCU Line STM32L4x6
MCU name STM32L4A6ZGTx
MCU Package LQFP144