<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-AT">
	<id>https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=SD_controller_%28CM-i.MX27%29</id>
	<title>SD controller (CM-i.MX27) - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=SD_controller_%28CM-i.MX27%29"/>
	<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=SD_controller_(CM-i.MX27)&amp;action=history"/>
	<updated>2026-05-13T12:46:04Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in BECOM Systems Support</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=SD_controller_(CM-i.MX27)&amp;diff=352&amp;oldid=prev</id>
		<title>Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=SD_controller_(CM-i.MX27)&amp;diff=352&amp;oldid=prev"/>
		<updated>2023-10-31T08:03:09Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de-AT&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 31. Oktober 2023, 10:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de-AT&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=SD_controller_(CM-i.MX27)&amp;diff=351&amp;oldid=prev</id>
		<title>en&gt;Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=SD_controller_(CM-i.MX27)&amp;diff=351&amp;oldid=prev"/>
		<updated>2023-08-22T19:35:52Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The i.MX27 contains an SD host controller that supports MMC, SD and SD I/O standards.&lt;br /&gt;
SDHC1 of the processor is connected to the SD cards lot on the DEV board.&lt;br /&gt;
&lt;br /&gt;
== Linux kernel configuration ==&lt;br /&gt;
&lt;br /&gt;
 Device Drivers  ---&amp;gt;&lt;br /&gt;
   &amp;lt;*&amp;gt; MMC/SD card support  ---&amp;gt;&lt;br /&gt;
     &amp;lt;*&amp;gt;   MMC block device driver&lt;br /&gt;
     [*]     Use bounce buffer for simple hosts&lt;br /&gt;
     &amp;lt;*&amp;gt;   Freescale MXC Multimedia Card Interface support&lt;br /&gt;
&lt;br /&gt;
== Test in Linux ==&lt;br /&gt;
&lt;br /&gt;
*Insert an SD card into the slot on the DEV board. You will see similar messages on the terminal:&lt;br /&gt;
 root@btmxc27:~# mmc0: host does not support reading read-only switch. assuming write-enable.&lt;br /&gt;
 mmc0: new SD card at address fcd9&lt;br /&gt;
 mmcblk0: mmc0:fcd9 SD02G 1985024KiB &lt;br /&gt;
  mmcblk0:&lt;br /&gt;
 FAT: bogus number of reserved sectors&lt;br /&gt;
 VFS: Can&amp;#039;t find a valid FAT filesystem on dev mmcblk0.&lt;br /&gt;
&lt;br /&gt;
*We will now start &amp;#039;&amp;#039;fdisk&amp;#039;&amp;#039; and create 1 partition on the card that uses up the full available space:&lt;br /&gt;
 root@btmxc27:~# fdisk /dev/mmcblk0 &lt;br /&gt;
 &lt;br /&gt;
 The number of cylinders for this disk is set to 62032.&lt;br /&gt;
 There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
 and could in certain setups cause problems with:&lt;br /&gt;
 1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
 2) booting and partitioning software from other OSs&lt;br /&gt;
    (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): p&lt;br /&gt;
 &lt;br /&gt;
 Disk /dev/mmcblk0: 2032 MB, 2032664576 bytes&lt;br /&gt;
 4 heads, 16 sectors/track, 62032 cylinders&lt;br /&gt;
 Units = cylinders of 64 * 512 = 32768 bytes&lt;br /&gt;
 &lt;br /&gt;
         Device Boot      Start         End      Blocks  Id System&lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): n&lt;br /&gt;
 Command action&lt;br /&gt;
    e   extended&lt;br /&gt;
    p   primary partition (1-4)&lt;br /&gt;
 p&lt;br /&gt;
 Partition number (1-4): 1&lt;br /&gt;
 First cylinder (1-62032, default 1): Using default value 1&lt;br /&gt;
 Last cylinder or +size or +sizeM or +sizeK (1-62032, default 62032): Using default value 62032&lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): p&lt;br /&gt;
 &lt;br /&gt;
 Disk /dev/mmcblk0: 2032 MB, 2032664576 bytes&lt;br /&gt;
 4 heads, 16 sectors/track, 62032 cylinders&lt;br /&gt;
 Units = cylinders of 64 * 512 = 32768 bytes&lt;br /&gt;
 &lt;br /&gt;
         Device Boot      Start         End      Blocks  Id System&lt;br /&gt;
 /dev/mmcblk0p1               1       62032     1985016  83 Linux&lt;br /&gt;
 &lt;br /&gt;
 Command (m for help): w&lt;br /&gt;
 The partition table has been altered!&lt;br /&gt;
 &lt;br /&gt;
 Calling ioctl() to re-read partition table&lt;br /&gt;
  mmcblk0: p1&lt;br /&gt;
 root@btmxc27:~# FAT: bogus number of reserved sectors&lt;br /&gt;
 VFS: Can&amp;#039;t find a valid FAT filesystem on dev mmcblk0p1.&lt;br /&gt;
&lt;br /&gt;
* Now we will create an &amp;#039;&amp;#039;ext3&amp;#039;&amp;#039; file system in this partition:&lt;br /&gt;
&lt;br /&gt;
 root@btmxc27:~# mkfs.ext3 /dev/mmcblk0p1 &lt;br /&gt;
 mke2fs 1.41.4 (27-Jan-2009)&lt;br /&gt;
 Filesystem label=&lt;br /&gt;
 OS type: Linux&lt;br /&gt;
 Block size=4096 (log=2)&lt;br /&gt;
 Fragment size=4096 (log=2)&lt;br /&gt;
 124160 inodes, 496254 blocks&lt;br /&gt;
 24812 blocks (5.00%) reserved for the super user&lt;br /&gt;
 First data block=0&lt;br /&gt;
 Maximum filesystem blocks=511705088&lt;br /&gt;
 16 block groups&lt;br /&gt;
 32768 blocks per group, 32768 fragments per group&lt;br /&gt;
 7760 inodes per group&lt;br /&gt;
 Superblock backups stored on blocks: &lt;br /&gt;
 	32768, 98304, 163840, 229376, 294912&lt;br /&gt;
 &lt;br /&gt;
 Writing inode tables: done                            &lt;br /&gt;
 Creating journal (8192 blocks): done&lt;br /&gt;
 Writing superblocks and filesystem accounting information: done&lt;br /&gt;
 &lt;br /&gt;
 This filesystem will be automatically checked every 26 mounts or&lt;br /&gt;
 180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&lt;br /&gt;
*Mount the SD card (first partition) to &amp;#039;&amp;#039;/media/card&amp;#039;&amp;#039;. Numbering of mmc block devices and partitions is &amp;#039;&amp;#039;&amp;#039;mmcblk&amp;#039;&amp;#039;&amp;#039;[card_nr]&amp;#039;&amp;#039;&amp;#039;p&amp;#039;&amp;#039;&amp;#039;[partition_nr], where the first possible &amp;#039;&amp;#039;card_nr&amp;#039;&amp;#039; is 0 and the first possible &amp;#039;&amp;#039;partition_nr&amp;#039;&amp;#039; is 1.&lt;br /&gt;
&lt;br /&gt;
 root@btmxc27:~# mount /dev/mmcblk0p1 /media/card/&lt;br /&gt;
 kjournald starting.  Commit interval 5 seconds&lt;br /&gt;
 EXT3 FS on mmcblk0p1, internal journal&lt;br /&gt;
 EXT3-fs: mounted filesystem with ordered data mode.&lt;br /&gt;
&lt;br /&gt;
*For measuring the performance, we will transfer a file from RAM to the SD card. Therefore, we also create an &amp;#039;&amp;#039;ext3&amp;#039;&amp;#039; file system on the ram disk:&lt;br /&gt;
 root@btmxc27:~# mkfs.ext3 /dev/ram0 &lt;br /&gt;
 mke2fs 1.41.4 (27-Jan-2009)&lt;br /&gt;
 Filesystem label=&lt;br /&gt;
 OS type: Linux&lt;br /&gt;
 Block size=1024 (log=0)&lt;br /&gt;
 Fragment size=1024 (log=0)&lt;br /&gt;
 16384 inodes, 65536 blocks&lt;br /&gt;
 3276 blocks (5.00%) reserved for the super user&lt;br /&gt;
 First data block=1&lt;br /&gt;
 Maximum filesystem blocks=67108864&lt;br /&gt;
 8 block groups&lt;br /&gt;
 8192 blocks per group, 8192 fragments per group&lt;br /&gt;
 2048 inodes per group&lt;br /&gt;
 Superblock backups stored on blocks: &lt;br /&gt;
 	8193, 24577, 40961, 57345&lt;br /&gt;
 &lt;br /&gt;
 Writing inode tables: done                            &lt;br /&gt;
 Creating journal (4096 blocks): done&lt;br /&gt;
 Writing superblocks and filesystem accounting information: done&lt;br /&gt;
 &lt;br /&gt;
 This filesystem will be automatically checked every 23 mounts or&lt;br /&gt;
 180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&lt;br /&gt;
*...and mount it to &amp;#039;&amp;#039;/media/ram&amp;#039;&amp;#039;:&lt;br /&gt;
 root@btmxc27:~# mount /dev/ram0 /media/ram/&lt;br /&gt;
 kjournald starting.  Commit interval 5 seconds&lt;br /&gt;
 EXT3 FS on ram0, internal journal&lt;br /&gt;
 EXT3-fs: mounted filesystem with ordered data mode.&lt;br /&gt;
&lt;br /&gt;
*Now we change to this directory and download a random file of 32 MiB size:&lt;br /&gt;
 root@btmxc27:~# cd /media/ram/&lt;br /&gt;
 root@btmxc27:/media/ram# tftp -r 32MBrandomfile -g 192.168.5.1&lt;br /&gt;
 root@btmxc27:/media/ram# ls&lt;br /&gt;
 32MBrandomfile  lost+found&lt;br /&gt;
&lt;br /&gt;
*Let&amp;#039;s transfer this file to the SD card and measure the time. The complete time can be calculated by adding both &amp;quot;real&amp;quot; times.&lt;br /&gt;
 root@btmxc27:/media/ram# cd /media/card/&lt;br /&gt;
 root@btmxc27:/media/card# ls&lt;br /&gt;
 lost+found&lt;br /&gt;
 root@btmxc27:/media/card# cd /&lt;br /&gt;
 root@btmxc27:/# time cp /media/ram/32MBrandomfile /media/card/ ; time umount /me&lt;br /&gt;
 dia/card/&lt;br /&gt;
 real	0m 10.72s&lt;br /&gt;
 user	0m 0.10s&lt;br /&gt;
 sys	0m 5.41s&lt;br /&gt;
 real	0m 5.97s&lt;br /&gt;
 user	0m 0.00s&lt;br /&gt;
 sys	0m 0.40s&lt;br /&gt;
&lt;br /&gt;
*To measure read performance, we mount the SD card again and read the 32 MiB file to &amp;#039;&amp;#039;/dev/null&amp;#039;&amp;#039; (i.e., nowhere).&lt;br /&gt;
 root@btmxc27:/# mount /dev/mmcblk0p1 /media/card/&lt;br /&gt;
 kjournald starting.  Commit interval 5 seconds&lt;br /&gt;
 EXT3 FS on mmcblk0p1, internal journal&lt;br /&gt;
 EXT3-fs: mounted filesystem with ordered data mode.&lt;br /&gt;
 root@btmxc27:/# time cat /media/card/32MBrandomfile &amp;gt; /dev/null ; time umount /m&lt;br /&gt;
 edia/card/&lt;br /&gt;
 real	0m 9.51s&lt;br /&gt;
 user	0m 0.02s&lt;br /&gt;
 sys	0m 1.40s&lt;br /&gt;
 real	0m 0.08s&lt;br /&gt;
 user	0m 0.01s&lt;br /&gt;
 sys	0m 0.04s&lt;br /&gt;
 root@btmxc27:/#&lt;br /&gt;
&lt;br /&gt;
*To check if the data was written correctly, you may check the &amp;#039;&amp;#039;md5sum&amp;#039;&amp;#039;s of both files:&lt;br /&gt;
 root@btmxc27:/# md5sum /media/ram/32MBrandomfile &lt;br /&gt;
 f507996f89cd0d6ff3f5e0edcf5aa0a1  /media/ram/32MBrandomfile&lt;br /&gt;
 root@btmxc27:/# md5sum /media/card/32MBrandomfile &lt;br /&gt;
 f507996f89cd0d6ff3f5e0edcf5aa0a1  /media/card/32MBrandomfile&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
Measured in Linux, using a &amp;#039;&amp;#039;SanDisk Extreme III 2.0GB&amp;#039;&amp;#039; card:&lt;br /&gt;
*Write: 1.92 MiB/s&lt;br /&gt;
*Read: 3.34 MiB/s&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
* If you remove the card very slowly, the removal may not be detected correctly.&lt;br /&gt;
&lt;br /&gt;
At removal, the CD (card detect) IRQ is triggered. But at this time, the SD card&lt;br /&gt;
is yet readable and the MMC driver does not detect the removal. We have increased&lt;br /&gt;
the wait time from IRQ to checking for removal to 1 second. If you are&lt;br /&gt;
extremely slow at removing the card, the removal may not be detected&lt;br /&gt;
correctly, though.&lt;br /&gt;
&lt;br /&gt;
* Don&amp;#039;t enable CONFIG_DEBUG_SHIRQ in your kernel configuration. The SD Card will refuse to work!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:i.MX27]]&lt;/div&gt;</summary>
		<author><name>en&gt;Peter</name></author>
	</entry>
</feed>