cancel
Showing results for 
Search instead for 
Did you mean: 

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

GS1
Senior III

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

1 ACCEPTED SOLUTION

Accepted Solutions
GS1
Senior III

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

View solution in original post

1 REPLY 1
GS1
Senior III

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