Using DAT3/CD as card detect pin on microsd-cards

Hi, we are using Verdin-IMX8MM on a custom carrier board together with Toradex Yocto BSP 5.2.

The micro-SDCard socket on our carrier board has no dedicated card detect pin. We want to use DAT3/CD pin instead, according this application note:

Question: Does the SDCard driver sdhci-esdhc-imx support this card detection method? If yes, how to activate it?

Hi @klausci

According to the Datasheet you shared the CardDetect has to be realized on Hardware. We recommend you to use a separate GPIO for CardDetect. We never tested this multiplexed version of DAT3/CD on our carrier boards but you can test this on the Toradex Verdin Evaluation Board.

I also found this NXP Thread, where a solution was discussed for iMX6.

Best regards,

Hi @jaski.tx ,
Thanks for your reply. I know that the recommended implementation of CardDetect is via a mechanical switch, but our cardholder doesn’t provide one, due to mechanical constraints.

I was already aware of the s NXP Thread, however, it’s from 2013 and I was hoping that the driver is now capable of handling the DAT3/CD mechanism. Anyway I will dig deeper and post my results here.
Best Regards, Klaus

Perfect. Let us know your results.

Best regards,

We gave up this approach. The DAT3/CD pin can be used only in 1-pin SDCard mode and this is not what we want.

Ok, so you go for a proper hardware solution?

Yes, either by using a SDCard Holder with mechanical CD pin, or by using some solution that detects the opening of our flap in front of our SDCard

Perfect. Thanks for the feedback.