Sporadic SDMMC_ERROR_CMD_RSP_TIMEOUT using FatFS + SDIO + DMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-07-03 1: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:
- Lowering the clock speed from 45MHz down to 1.4 MHz
- Increase the timeout in SDMMC_GetCmdResp1() from 1ms to 100ms
- Enable SDIO HW flow control
Has anyone experienced this issue? Is there a workaround?
Thanks and best!
- Labels:
-
DMA
-
FatFS
-
SDIO-SDMMC
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-14 3: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-15 9:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-06 2:15 AM
For me, this was solved by setting all pins in HAL_SD_MspInit function to GPIO_PULLUP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-08 3:41 AM
Thanks for your answer @Hoddy​, unfortunately it does not solve our issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-12 3: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
