AnsweredAssumed Answered

stm32f4xx_hal_sd. c error

Question asked by rossi.giovanni on Jun 28, 2016
Latest reply on Jun 29, 2016 by FTITI.Walid
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 at 


static 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




Outcomes