2019-07-03 01:15 AM
Hi all,
I am trying to write to SD Card through SDIO interface with DMA (1 data line) on a STM32F4 MCU on a custom made board. Configuration is done by CubeMX.
When writing to one file at a rate of 200kBytes every 10 seconds, after some time (one minute to ten minutes), the driver fails in SDMMC_GetCmdResp1() (file stm32f4xx_II_sd.h) with error code SDMMC_ERROR_CMD_RSP_TIMEOUT.
Following fixes have been tried out without success:
Has anyone experienced this issue? Is there a workaround?
Thanks and best!
2019-09-12 11:11 PM
Hello.
i am using same problem using stm32f779bi on also my custom board
have you any other idea to solve out this problem?
2019-09-13 12:14 AM
Hi,
I introduced a fail-save machanism, that simply remounts the SD Card in case of any error and rewrites the data... Not the proper way to go, more like a work-around. We will try to reduce SDIO line length in a new PCB version and investigate the error at that point.
If you have any news, please let me know.
Best,
2019-09-14 03:28 AM
Thansks for replying @auraner
i will try your way to get working of this problem
i will definately let you know if i get any other information about this problem
Thanks again
2019-09-15 09:28 PM
2020-01-06 02:15 AM
For me, this was solved by setting all pins in HAL_SD_MspInit function to GPIO_PULLUP
2020-01-08 03:41 AM
Thanks for your answer @Hoddy, unfortunately it does not solve our issue...
2023-02-12 03:16 PM
Thanks for your answer @Hoddy (Community Member), I just confirm:
pullup CMD pin (no matter, with GPIO_PULLUP or with external resistor) is enough.
2024-01-22 11:48 PM
Hi all.
I had a similar problem. The SD state before the write call was HAL_SD_CARD_PROGRAMMING. I added a state check and now everything works fine.
HAL_SD_CardStateTypeDef state ;
do
{
state = HAL_SD_GetCardState(&hsd);
}
while (state == HAL_SD_CARD_RECEIVING || state == HAL_SD_CARD_SENDING || state == HAL_SD_CARD_PROGRAMMING);
sd_state = HAL_SD_WriteBlocks_DMA(&hsd, (uint8_t*) pData, WriteAddr, NumOfBlocks);
Best