2021-09-09 01:37 PM
Hi all.
I'm working on STM32F427VI + Hal Library generated by CubeMX6.2. I use DMA and set the clock frequency of the SDMMC controller to 24MHz.
If an SD error occurs through the run of the program, I remount SD Card by the following functions:
1 - MX_FATFS_Init;
2 - HAL_SD_InitCard;
3 - result = f_mount(&FATFS, " ", 1);
These steps work well and the result turns to FR_OK usually, But in some cases, it totally returns FR_DISK_ERROR. If issues occur before I mount SDCard, the result returns FR_NOT_READY or FR_DISK_ERROR and never solve with try above steps. For example, it fails when I plug out SD before mounting it and then mounts, get FR_NOT_READY, plug-in SD, and remount. This problem also happens when I switch the MicroSD pins between STM32 and ESP8266.
Finally. I should plug out - plug-in MicroSD or reset micro to fix the issue.
It is really important for me and my project! to remount SD successfully and we both hope someone helps us :smiling_face_with_smiling_eyes: .