2016-06-28 01:05 AM
Hi! I have a problem with SD card
I write a file every second (30 byte added at the end of file) (SDcard @ 4MHz clock 4 wire) and sometimes, when firmware enters in HAL_SD_ReadBlocks function, it blocks at this stage /* Poll on SDIO flags */ #ifdef SDIO_STA_STBITERR while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND | SDIO_FLAG_STBITERR)) #else /* SDIO_STA_STBITERR not defined */ while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DATAEND)) #endif /* SDIO_STA_STBITERR */ { if (__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXFIFOHF)) { why this behaviour ? Why FLAG RXFIFOHF isn't update? I have also another block atstatic HAL_SD_ErrorTypedef SD_CmdResp1Error(SD_HandleTypeDef *hsd, uint8_t SD_CMD) { HAL_SD_ErrorTypedef errorstate = SD_OK; uint32_t response_r1; while(!__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))
{
}
this flag aren't update and I remain here forever: how is it possible? Why in a library I have a blocking cycle?
Thank you very much
2016-06-29 03:47 AM
Hi rossi.giovanni,
Please give more details about : Hardware/device are you using and the Hal library / STM32Cube versions you have used ? -Hannibal-