At the moment I got a problem detecting if the SD Card is there and alive.
In our System we permanently install an SD Card and so we do not have a Card detect signal.
Also, a Card detect signal is irrelevant for the describes scenario.
In Case of an SD Card failing, we want to be able to detect, if it is still there and writable.
First, I just tried to detect a lost SD Card by checking if the folder “\SD Card” is still reachable. But if I remove the SD card from the SD Card Slot without toggling the Card Detect Signal, the SD Card is still shown in the Windows explorer.
Second, I tried to write a File using fstream to the SD Card, flush() the fstream and ask for the good() Bit.
This works, but only if I write enough data into the File to overcome the Windows cache (I guess?).
I can even write small files using the Notepad without it noticing, that there is no SD Card and also successfully open the Files again.
So, does anybody have an Idea, how I can detect if the SD Card died or get Windows to notice if it died?
Thank you in advance!