Read CID of SDcard connected to USB-SD Reader under Linux

怎甘沉沦 提交于 2021-02-10 15:20:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!