If SD card is not seen in the system, it may happen that card is physically inserted and has failed. I can’t find the way to read the switch state. The device tree defines “cd” GPIO and it is being used, but nothing in the /sys tree which I may poll to see if card is physically in or not. It would be a surprise if this user space functionality is not preset / omitted in the driver, because it is one of the basic diagnostic things to present to the user to allow card state remote diagnostics.
First would be to extract OEM dts, then expose the SD-card related gpio-s (base offsets often differ betwwen OpenWrt and OEM) and read them. Note that RO switch is optical only, not diode logic in the card itself.
The GPIO is used by the driver. I must not be able to export it - however I did not try here.
IMHO the only way should be through the driver.
Apologies did not get it, can you elaborate please? The card detect is just two contacts assembly closing or opening when card is physically inserted or removed.
The goal is to see if there’s anything in the slot, would it be cardboard or coin. In any case if there’s something in the slot BUT the card not in the system there’s something wrong.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button (red circle; this works best in the 'Markdown' composer view in the blue oval):
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have: