Skip to main content

eMMC

The boards have an eMMC flash that is used for persistent storage. The size of the eMMC can be different for different boards and the device IDs associated with the eMMC can also be different for different boards. The table below lists the device IDs for the different boards.

BoardU-Boot 2017.03U-Boot = 2018-03U-Boot 2020.04Linux
iMX6 SoloX COMmmc dev 1mmc dev 0mmc dev 2/dev/mmcblk2
iMX6 Quad COMmmc dev 2mmc dev 1mmc dev 3/dev/mmcblk3
iMX6 DualLite COMmmc dev 2mmc dev 1mmc dev 3/dev/mmcblk3
iMX6 UltraLite COMmmc dev 1mmc dev 0mmc dev 1/dev/mmcblk1
iMX7 Dual (u)COMmmc dev 1mmc dev 1mmc dev 2/dev/mmcblk2
iMX7ULP uCOMN/Ammc dev 0mmc dev 0/dev/mmcblk0
iMX8M Quad COMN/Ammc dev 0mmc dev 0/dev/mmcblk0
iMX8M Mini uCOMN/Ammc dev 1mmc dev 2/dev/mmcblk2
iMX8M Nano uCOMN/Ammc dev 1mmc dev 2/dev/mmcblk2
iMX93 uCOMN/AN/Ammc dev 0 */dev/mmcblk0
* - The iMX93 was added first in U-Boot 2022-04

U-Boot

One of the roles of the U-Boot is to write new bootloader(s), Linux kernel and file systems to eMMC. To accomplish this there are a set of U-Boot commands available:

mmc
mmc - MMC sub system

Usage:
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
- Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
- Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
- Change the bits of the PARTITION_CONFIG field of the specified
device
mmc rst-function dev value
- Change the RST_n_FUNCTION field of the specified device
WARNING: This is a write-once field and 0 / 1 / 2 are the only
valid values.
mmc setdsr - set DSR register value
warning

Take care when using the commands as they will potentially corrupt the system!

A couple of safe commands (shown for the iMX6 UltraLite COM board).

Select device

mmc dev 1
mmc1(part 0) is current device

Get information about the device

mmcinfo
Device: FSL_SDHC
Manufacturer ID: fe
OEM: 14e
Name: MMC04
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 3.5 GiB
Bus Width: 8-bit

Show partitions on the device

mmc part
Partition Map for MMC device 1 -- Partition Type: DOS

Part Start Sector Num Sectors UUID Type
1 8192 16384 00000000-01 0c
2 24576 7364608 00000000-02 83

Show available device tree files

fatls mmc 2
 29927936   Image
1492 boot.scr
37966 imx8mn-ea-ucom-kit_v2-1mw.dtb
38578 imx8mn-ea-ucom-kit_v2-m4.dtb
39089 imx8mn-ea-ucom-kit_v2-ov5640.dtb
37802 imx8mn-ea-ucom-kit_v2-usb-host.dtb
37798 imx8mn-ea-ucom-kit_v2.dtb
37138 imx8mn-ea-ucom-kit_v3-m4.dtb
37679 imx8mn-ea-ucom-kit_v3-ov5640.dtb
36388 imx8mn-ea-ucom-kit_v3.dtb
35898 imx8mn-ea-ucom-ptp-1mw.dtb
34550 imx8mn-ea-ucom-ptp.dtb

Linux

As Linux boots from the eMMC it is available when you log in.

Available disk space

df -h
Filesystem     Size     Used   Available Use% Mounted on
/dev/root 3.4G 65.2M 3.2G 2% /
devtmpfs 340.0M 0 340.0M 0% /dev
tmpfs 500.1M 216.0K 499.9M 0% /run
tmpfs 500.1M 76.0K 500.1M 0% /var/volatile

Create a file

echo Hello > greeting

Show content of a file

cat greeting
Hello

List files

ls -la
drwxr-xr-x   2 root    root      1024 Sep 23 15:25 .
drwxr-xr-x 3 root root 1024 Sep 23 14:52 ..
-rw-r--r-- 1 root root 12 Sep 23 15:25 greeting