<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://ess-wiki.advantech.com.tw/wiki/index.php?action=history&amp;feed=atom&amp;title=How_to_use_SD%2FMMC_Card_for_Diagnostic</id>
		<title>How to use SD/MMC Card for Diagnostic - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://ess-wiki.advantech.com.tw/wiki/index.php?action=history&amp;feed=atom&amp;title=How_to_use_SD%2FMMC_Card_for_Diagnostic"/>
		<link rel="alternate" type="text/html" href="https://ess-wiki.advantech.com.tw/wiki/index.php?title=How_to_use_SD/MMC_Card_for_Diagnostic&amp;action=history"/>
		<updated>2026-05-21T10:21:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.3</generator>

	<entry>
		<id>https://ess-wiki.advantech.com.tw/wiki/index.php?title=How_to_use_SD/MMC_Card_for_Diagnostic&amp;diff=18653&amp;oldid=prev</id>
		<title>Wei.zeng: Created page with &quot;SD/MMC cards which use the MMC subsystem are available as block device through /dev/mmcblk{id}. The kernel normally parses the partition table and exports the partitions of th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://ess-wiki.advantech.com.tw/wiki/index.php?title=How_to_use_SD/MMC_Card_for_Diagnostic&amp;diff=18653&amp;oldid=prev"/>
				<updated>2020-03-20T05:56:31Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;SD/MMC cards which use the MMC subsystem are available as block device through /dev/mmcblk{id}. The kernel normally parses the partition table and exports the partitions of th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;SD/MMC cards which use the MMC subsystem are available as block device through /dev/mmcblk{id}. The kernel normally parses the partition table and exports the partitions of the card using the appendix p{x}, e.g. /dev/mmcblk{id}p{x}.&lt;br /&gt;
&lt;br /&gt;
= [https://developer.toradex.cn/knowledge-base/sd-mmc-card-(linux)#sdmmc-driver-initialisation SD/MMC driver initialisation] =&lt;br /&gt;
&lt;br /&gt;
The following bootlog shows the detection of a SDHCI controller:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); width: 1007px; height: 144px; color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# dmesg | egrep &amp;quot;(sdhci|mmc)&amp;quot;&lt;br /&gt;
[    1.880782] sdhci: Secure Digital Host Controller Interface driver&lt;br /&gt;
[    1.890679] sdhci: Copyright(c) Pierre Ossman&lt;br /&gt;
[    1.898540] sdhci-pltfm: SDHCI platform and OF driver helper&lt;br /&gt;
[    1.909980] sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO&lt;br /&gt;
[    1.984346] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before inserting any card no interrupts are generated yet:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /proc/interrupts | egrep &amp;quot;(mmc|cd)&amp;quot;&lt;br /&gt;
 58:          0       GPC  22 Level     mmc0&lt;br /&gt;
200:          0  gpio-mxc   0 Edge      2190000.usdhc cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the IOs debugging information is not valid yet:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /sys/kernel/debug/mmc0/ios&lt;br /&gt;
clock:          0 Hz&lt;br /&gt;
vdd:            0 (invalid)&lt;br /&gt;
bus mode:       2 (push-pull)&lt;br /&gt;
chip select:    0 (don't care)&lt;br /&gt;
power mode:     0 (off)&lt;br /&gt;
bus width:      0 (1 bits)&lt;br /&gt;
timing spec:    0 (legacy)&lt;br /&gt;
signal voltage: 0 (3.30 V)&lt;br /&gt;
driver type:    0 (driver type B)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the MMC_CD card detection GPIO pin still being pulled-up:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /sys/kernel/debug/gpio | grep cd&lt;br /&gt;
 gpio-128 (                    |cd                  ) in  hi IRQ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [https://developer.toradex.cn/knowledge-base/sd-mmc-card-(linux)#sdmmc-card-insertion SD/MMC Card Insertion] ==&lt;br /&gt;
&lt;br /&gt;
On insertion, the kernel starts scanning the card in order to create devices for each partition. Depending on the Automount configuration the detected file systems get mounted automatically.&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;[  286.140413] mmc0: new high speed SDHC card at address 0007&lt;br /&gt;
[  286.150926] mmcblk0: mmc0:0007 SDCIT 7.29 GiB&lt;br /&gt;
[  286.170497]  mmcblk0: p1 p2&lt;br /&gt;
[  287.691840] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Interrupts are happening (note one card detect GPIO interrupt thereof):&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /proc/interrupts | egrep &amp;quot;(mmc|cd)&amp;quot;&lt;br /&gt;
 58:        375       GPC  22 Level     mmc0&lt;br /&gt;
200:          1  gpio-mxc   0 Edge      2190000.usdhc cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the IOs debugging information should now show valid information about the inserted card:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /sys/kernel/debug/mmc0/ios&lt;br /&gt;
clock:          50000000 Hz&lt;br /&gt;
actual clock:   49500000 Hz&lt;br /&gt;
vdd:            21 (3.3 ~ 3.4 V)&lt;br /&gt;
bus mode:       2 (push-pull)&lt;br /&gt;
chip select:    0 (don't care)&lt;br /&gt;
power mode:     2 (on)&lt;br /&gt;
bus width:      2 (4 bits)&lt;br /&gt;
timing spec:    2 (sd high-speed)&lt;br /&gt;
signal voltage: 0 (3.30 V)&lt;br /&gt;
driver type:    0 (driver type B)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the MMC_CD card detection GPIO pin now being pulled to ground:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /sys/kernel/debug/gpio | grep cd&lt;br /&gt;
 gpio-128 (                    |cd                  ) in  lo IRQ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More specifics about the inserted card can be found in its CID/CSD:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /sys/bus/mmc/devices/mmc0\:0007/cid&lt;br /&gt;
413432534443495430002e35cf012800&lt;br /&gt;
root@:~# cat /sys/bus/mmc/devices/mmc0\:0007/csd&lt;br /&gt;
400e00325b5900003a4f7f800a400000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The utility df shows the usage of the SD/MMC card:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# df | grep mmc&lt;br /&gt;
/dev/mmcblk0p2         1467980    903468    470664  66% /media/mmcblk0p2&lt;br /&gt;
/dev/mmcblk0p1           85010     22894     62116  27% /media/mmcblk0p1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And mount shows the mounting status:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# mount | grep mmc&lt;br /&gt;
/dev/mmcblk0p2 on /media/mmcblk0p2 type ext4 (rw,relatime,data=ordered)&lt;br /&gt;
/dev/mmcblk0p1 on /media/mmcblk0p1 type vfat (rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From regular SD cards one should be able to read with sustained data rates of around 10 to 20 MB/sec:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# hdparm -t /dev/mmcblk0&lt;br /&gt;
&lt;br /&gt;
/dev/mmcblk0:&lt;br /&gt;
 Timing buffered disk reads:  66 MB in  3.04 seconds =  21.70 MB/sec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [https://developer.toradex.cn/knowledge-base/sd-mmc-card-(linux)#sdmmc-card-removal SD/MMC Card Removal] ==&lt;br /&gt;
&lt;br /&gt;
Kernel message:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;[  441.027332] mmc0: card 0007 removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Triggered by another card detection interrupt:&lt;br /&gt;
&amp;lt;pre style=&amp;quot;background: rgb(255, 255, 255); margin: 3px 0px; padding: 10px; border-radius: 4px; border: 1px dotted rgb(204, 204, 204); color: rgb(0, 0, 0); text-transform: none; line-height: 1.4285; text-indent: 0px; letter-spacing: normal; overflow: auto; font-family: monospace !important; font-size: 14px; font-style: normal; font-weight: 400; word-spacing: 0px; display: block; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; box-sizing: border-box; orphans: 2; widows: 2; tab-size: 4; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; hyphens: none;&amp;quot;&amp;gt;root@:~# cat /proc/interrupts | egrep &amp;quot;(mmc|cd)&amp;quot;&lt;br /&gt;
 58:        641       GPC  22 Level     mmc0&lt;br /&gt;
200:          2  gpio-mxc   0 Edge      2190000.usdhc cd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wei.zeng</name></author>	</entry>

	</feed>