简体   繁体   中英

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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM