cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get SD Card connect and disconnect interrupts

RN
Senior

Hello All,

I want to get an interrupt whenever i connect or disconnect sd card in to sd card slot . How to do this ?

I have stm32f7 discovery board . I searched in hal_sdio.c , but couldnt get any info.

what is the best way to achieve this ? Thank you .

One idea i have is to check card status in the systick handler.

Thanks in advance

2 REPLIES 2
Clive1 (HNL)
Senior II

>>stm32f7 discovery board 

Which one, be specific

Usually two methods depending on design, either as a GPIO directly attached to the micro, and generating an EXTI interrupt, or via the MFX (IO Expander), which can be configured at a pin level to cause interrupts, via a GPIO/EXTI source for a pin connected to the MFX.

Perhaps look at the examples in the Applications\Display or Example\JPEG directories for examples using the SD Card and implementing the card checking. Or within the SD BSP code for the board.

RN
Senior

Hi Clive ,

Thanks for the reply, actually i am using this board

https://www.st.com/en/evaluation-tools/32f746gdiscovery.html

Usually two methods depending on design, either as a GPIO directly attached to the micro, and generating an EXTI interrupt

but the sd connector on this board is not connected to any gpio, and how the voltage level changes during insertion and removal of the card to trigger the exti interrupt .