问题
I can read CID info easily when the card is connected to SDIO interface:
stulluk@debian:~$ cat /sys/bus/mmc/devices/mmc0\:0007/cid
0150414a4836344713da8544b3012300
stulluk@debian:~$
But when I connect same card to USB-SDCard reader, I couldn't find any interface to read it in sysfs.
Is there such interface in Linux? Or, is there any other way to read from registers of SDcard over USB in Userspace, without modifying Linux Kernel ?
Many thanks.
回答1:
But when I connect same card to USB-SDCard reader, I couldn't find any interface to read it in sysfs.
That would be because it's not available.
USB SD card readers use the USB Mass Storage device class. This interface is media-agnostic -- it's essentially a simplified version of SCSI. It doesn't provide any standard way of accessing SD-specific information, like the CID register, and most SD readers don't implement anything of the sort.
来源:https://stackoverflow.com/questions/50981056/read-cid-of-sdcard-connected-to-usb-sd-reader-under-linux