2024-01-12 04:16 AM
Dear Sir,
I have interfaced SDHC card 32GB of Sandisk with STM32L452RET6 microcontroller SDMMC1 peripheral in mode - SD 4 bit wide bus. In my device SD card as a Datalogger.
Issue - When my device is working mean data is logging (Data writing in SD card). In this period i have cut SD CMD line and again connected.
In this period - function this SDMMC_GetCmdResp1 return a error.
In working condition - Which routine we have to call to fix this issue???
Please suggest solution for this issue.....
2024-01-12 04:32 AM - edited 2024-01-12 04:33 AM
Hi,
>In this period i have cut SD CMD line and again connected. <
This means ...what ? you cut the trace ?
+
SDcard is working , mount , read dir , read file -> ok ?
2024-01-12 05:35 AM
I mean, if you're cutting traces, it's expected that an error will occur. Don't cut traces to prevent this from happening.
If the peripheral gets into a weird state, re-initialize it from the beginning. But you might not need to do anything. You may just need to re-send the command you want.
SDIO is fairly complicated. The specification has a nice flowchart for the internal state machine and what happens in various error scenarios. What happens will depend on what state it was in when CMD was cut.
2024-01-14 08:54 PM
Dear Sir,
Thanks for the reply.
Yes i have cut trace of the CMD line then it instant function returns error.
This procedure i am doing in debug mode. I have already place break point for the scanning of error. When debugger received error then its code of execution has stop. Then again i have reconnect the CMD trace. And reinitialize
MX_SDMMC1_SD_Init();
MX_FATFS_Init();
MX_SPI1_Init();
MountSDCard ();
i am doing re-initialization of the peripheral but SD card not becomes mount. It gives again error. Why it is not mount???