Using SD Card in Linux Print

 

The Emcraft i.MX 8M SOM-BSB provides a 4-bit SDXC UHS-I compatible card slot that can be used for booting Linux from SD Card as well as for storing user data. For optimal performance, it is recommended to use SD cards with speed class 10 or higher (UHS speed class 3).

Refer to Booting Linux from SD Card for detailed information on how to install bootable Linux images to SD Card and then boot the i.MX 8M SOM from this SD.


SD Card Properties

Run the following Linux commands to find out various properties of the inserted SD Card:

root@imx8m-som:~# cat /sys/block/mmcblk1/device/name SL16G root@imx8m-som:~# cat /sys/block/mmcblk1/size | awk -e '{printf "%.1f G\n", $1*512/1024/1024/1024}' 14.8 G root@imx8m-som:~# cat /sys/block/mmcblk1/device/serial 0xc80f46cb

Run the following Linux command to view parameters of the SD bus:

clock: 50000000 Hz actual clock: 50000000 Hz vdd: 21 (3.3 ~ 3.4 V) bus mode: 2 (push-pull) chip select: 0 (don't care) power mode: 2 (on) bus width: 2 (4 bits) timing spec: 7 (sd uhs DDR50) signal voltage: 1 (1.80 V) driver type: 0 (driver type B)

SD Card Read-Write Performance

The following Linux commands can be used to measure raw SD Card performance:

  • Measure SD Card write throughput:
  • root@imx8m-som:~# dd if=/dev/urandom of=/test oflag=direct bs=1MiB count=100 100+0 records in 100+0 records out 104857600 bytes (105 MB, 100 MiB) copied, 8.26725 s, 12.7 MB/s

  • Measure SD Card read throughput:
  • root@imx8m-som:~# echo 3 > /proc/sys/vm/drop_caches root@imx8m-som:~# dd if=/test of=/dev/null bs=1MiB count=100 100+0 records in 100+0 records out 104857600 bytes (105 MB, 100 MiB) copied, 2.4917 s, 42.1 MB/s

Note that the above commands assume that the root filesystem is located on the same SD Card which performance is measured.