Mat
Mat

Reputation: 73

Detecting removed SD-Card - C - ARM -

how it is possible to detect the removed SD-Card, and after that how it is possible to detect the inserting and do the re-mounting? I am working at STM32-F401 in C and with fatfs. Detecting incorrect mounting or removed card is relatively easy:

fresult1 = f_mount(&myFATAFS, SDPath, 1)
while(FR_OK != fresult1){
     /*Watch out for sd-card and if you find one try to mount*/
     ...
}

And now?

Upvotes: 0

Views: 812

Answers (1)

0___________
0___________

Reputation: 67476

You can't do it from this level. SD interface has line CD - CardDetect. You should connect it to GPIO and test it in the timer interrupt (EXTI interrupts are not good for that as debouncing is needed)

Upvotes: 2

Related Questions