2018-08-29 09:19 AM
My SD card interface (using SDMMC1) stops working after the SD card has been removed/re-inserted.
I have tried un-mounting using f_mount(0, &SDPath, 0) and then re-mounting with no success.
As a test, I executed the following for each transaction:
f_mount(&SDFatFs, &SDPath, 0);
f_open(&SDFile,.....);
f_write(&SDFile, .....);
f_close(&SDFile);
f_mount(0, &SDPath, 0);
If I remove/re-insert the SD card after the 1st transaction, I get an FR_DISK_ERR error on the f_open() on the second transaction (following the reinsertion of the SD card). I have traced this error down into the HAL_SD_ReadBlocks_DMA() functions which gets a timeout on the call to SDMMC_CmdBlockLength(hsd->Instance, BLOCKSIZE).
Any suggestions?
Solved! Go to Solution.
2021-12-08 07:13 AM
thank you so much <3