AnsweredAssumed Answered

STM32 SDHC in sleep mode ? [SOLVED]

Question asked by Petr_K on Jun 20, 2015
Latest reply on Jun 20, 2015 by Clive One
i have a little problem with SDHC card via SDIO. I use 3 types of sd cards, all works but with one type i have problem. When i mount sd and immediately  start write or read, all is ok, but when add some pause between reading or writing (cca > 50ms) i get from Fatfs DISK IO Error.  Problem is in function HAL_SD_ReadBlocks:
  /* Set Block Size for Card */
  sdio_cmdinitstructure.Argument         = (uint32_t) BlockSize;
  sdio_cmdinitstructure.CmdIndex         = SD_CMD_SET_BLOCKLEN;
  sdio_cmdinitstructure.Response         = SDIO_RESPONSE_SHORT;
  sdio_cmdinitstructure.WaitForInterrupt = SDIO_WAIT_NO;
  sdio_cmdinitstructure.CPSM             = SDIO_CPSM_ENABLE;
  SDIO_SendCommand(hsd->Instance, &sdio_cmdinitstructure);
  /* Check for error conditions */
  errorstate = SD_CmdResp1Error(hsd, SD_CMD_SET_BLOCKLEN);
  if (errorstate != SD_OK)
    return errorstate; //Here i get Timeout

Others Card works fine (different company)
PS: i use HAL library with DMA transfer created in STM32CubeMx.

Thank You