This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: SD card detect

Part Number: AM3352

Tool/software: Linux

Hi

I am developing for a board based on the beaglebone black and I am looking for the most correct way for a userspace application (written in C) to detect that an SD card has been inserted (or indeed removed) .

Up until now i have been using the SD card to boot and run from

  •  ultimately it is intended that this will be used only for storing user data 

I can see entries in dmesg when I remove/insert the card

 [ 108.484135] mmc0: card 59b4 removed

 [ 109.638096] mmc0: new high speed SDHC card at address 59b4

but unfortunately as I am running from the card at present doing this means I cannot properly investgate the removed state.

I should be runing from an onboard location shortly, but in the meantime, does anyone have any advice or recommendations for how I might go about detecting that the SD card has been removed in a timely manner?

Thanks for any help.

All the best,

- Richard