Skip to main content
GS1
Senior III
December 16, 2021
Solved

How can I handle "SD card is being extracted and reinserted while system is running" (STM32H7 with FATFS)?

I am stuggling with following task:

My system is running with SDCard perfectly when either SD card is inserted or not at power on. So file system is working if card is present at power on.

It also detects when the card is extracted while system is running and unmounts the file system.

Now I thought it would be nice to reinstall the file handling if I reinsert the card again.

But BSP_SD_Init (in bsp_driver_sd) returns 1 (Error).

Is anybody out there, who did this before and can help? What has to be done to properly deinstall the SD card handlers when the card is extracted?

Any help is very much appreciated!

Best regards

GS

This topic has been closed for replies.
GS1
GS1Best answer
Senior III
December 21, 2021

Ok, it is working now. I do not switch off Power after the card has been extracted. Then it worked.

1 reply

GS1
GS1AuthorBest answer
Senior III
December 21, 2021

Ok, it is working now. I do not switch off Power after the card has been extracted. Then it worked.