How can I "remount" an SD-card?
Hello.
Short Story:
I'm doing a little project that has to write some sensor data to an SD-Card.
After setting up with CubeMX, I found this (well-known) example of "kiwih" (https://github.com/kiwih/cubemx-mmc-sd-card?fbclid=IwAR1JE_SkRHDFSikRvwptlszMZUA-ZmuBhtI3UJPCThuC68mt_NsgG7M5qTE).
Everything is working perfect and I can do f_mount, f_open, etc ...
So far so good.
Problem:
To facilitate the connection of the SD-Card I used a uSD extension so I can not use the "card dettect" pin.

Sometimes the system boots and no card is present. So when I do f_mount I check if the answer is "FR_OK".
After that I wait to introduce the uSD and try "f_mount" again.
The problem is that as long as I do not reset the MCU, the response from f_mount (already with the card inserted) is always "FR_DISK_ERR".
I have already tried restart the SPI, the FATFS, clean the FATFS object, etc ...
But all my attempts were unsuccessful.
In this case, having to reset the MCU is not a solution for me.
Does anyone have any ideas that can help me?
Thank you!



