eMMC Boot


Tip

The various eMMC images are available for download here…

Available eMMC Image Download Links

Processor

Download Links Table

i.MX6DL

eMMC Image Downloads Table

STM32MP1571

eMMC Image Downloads Table

STM32MP1572

eMMC Image Downloads Table

Setting up the G3 module to boot from eMMC requires a different image which is available for download. The image is packaged in a tarball that includes a Mender3 artifact, a manifest file, the bziped image and a u-boot image. The following bash sessions show how to:

  • Unpack the tarball

  • Decompress the image

  • Use the mkemmc.sh script to flash the u-boot and Linux images to eMMC

Note

In most cases, the eMMC will have existing partitions and need to be zeroed before the Linux image is flashed. To guarantee the kernel recognizes all old partitions are gone, the mkemmc.sh script will reboot the system after zeroing the eMMC. You must then re-enter the mkemmc.sh command with the same arguments to perform the actual flash.

The first two steps should be completed on a Linux desktop as it will be much slower on the target device. If you’re using a Windows 10 development host, you can perform these steps inside the Reach Technology G3 Developer VM. The extracted u-boot and decompressed Linux image should be copied to a USB stick to transfer to the G3 module.

Tip

The following examples used the Beta 2.2 eMMC tarball. Be sure to substitute filenames consistent with the release you download.

Unpacking the tarball…

 1# to get the size of the downloaded file to compare to the value on the website
 2> ls -l
 3total 1005768
 4-rw-r--r-- 1 reach reach 1029903360 Jul 30 13:46 imx6dl-g3-emmc-beta-2.2.tar
 5
 6# to generate the hash of the downloaded file to compare to the value on the website
 7> md5sum imx6dl-g3-emmc-beta-2.2.tar
 86e38388f053338c585c2bbf73ecb1d41  imx6dl-g3-emmc-beta-2.2.tar
 9
10# to unpack the tarball
11> tar xvf imx6dl-g3-emmc-beta-2.2.tar
12reach-image-qt5-imx6dl-g3-emmc-20200625182854.rootfs.manifest
13reach-image-qt5-imx6dl-g3-emmc-20200625182854.mender
14reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg.bz2
15u-boot-imx6dl-g3-emmc-v2019.01+gitAUTOINC+7c81ebfabc-r0.imx

Decompressing the image…4

1# to decompress the image file
2> bunzip2 reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg.bz2
3
4# to copy the u-boot and Linux images to the USB stick
5> cp u-boot-imx6dl-g3-emmc-v2019.01+gitAUTOINC+7c81ebfabc-r0.imx reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg /run/media/usbstick

Now, on the G3 module, the USB stick will automount at /run/media/sda1 when inserted5.

1# change to the USB stick on the G3BNG
2root@imx6dl-g3-sd:~# cd /run/media/sda1/B_2.2
3root@imx6dl-g3-sd:/run/media/sda1/B_2.2# ls -l
4total 3716768
5-rwxrwx--- 1 root disk  367331328 Jun 25 11:34 reach-image-qt5-imx6dl-g3-emmc-20200625182854.mender*
6-rwxrwx--- 1 root disk      69870 Jun 25 11:32 reach-image-qt5-imx6dl-g3-emmc-20200625182854.rootfs.manifest*
7-rwxrwx--- 1 root disk 3438280704 Jun 25 11:32 reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg*
8-rwxrwx--- 1 root disk     277504 Jun 25 11:30 u-boot-imx6dl-g3-emmc-v2019.01+gitAUTOINC+7c81ebfabc-r0.imx*

Here’s the actual eMMC flash. The first argument is the name of the u-boot image. The second argument is the Linux image you just decompressed. Note the automatic reboot after zeroing eMMC. It will take a bit over four minutes to zero eMMC.

 1# to flash the u-boot and Linux images to eMMC
 2root@imx6dl-g3-sd:/run/media/sda1/B_2.2# mkemmc.sh u-boot-imx6dl-g3-emmc-v2019.01+gitAUTOINC+7c81ebfabc-r0.imx reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg
 3
 4checking for eMMC partition at "/run/media/mmcblk3p1"
 5
 6checking for eMMC partition at "/run/media/mmcblk3p2"
 7
 8checking for eMMC partition at "/run/media/mmcblk3p3"
 9
10checking for eMMC partition at "/run/media/mmcblk3p4"
11
12found existing eMMC partitions...
13zeroing out eMMC
147818182656 bytes (7.8 GB, 7.3 GiB) copied, 279 s, 28.0 MB/s
15932+0 records in
16932+0 records out
177818182656 bytes (7.8 GB, 7.3 GiB) copied, 290.648 s, 26.9 MB/s
18
19rebooting...
20rerun mkemmc.sh after the reboot
21
22
23The system is going down for reboot NOW! (ttymxc0) (Thu Jul 30 22:34:33 2020)
24INIT: Sending processes the TERM signal
25
26# ... a bunch of output snipped here for readability ...
27
28Rebooting... reboot: Restarting system
29
30
31U-Boot 2019.01 (Jun 24 2020 - 21:26:46 +0000)
32
33CPU:   Freescale i.MX6DL rev1.3 at 792 MHz
34Reset cause: WDOG
35Board: imx6dl-g3
36I2C:   ready
37DRAM:  2 GiB
38MMC:   FSL_SDHC: 0, FSL_SDHC: 1
39Loading Environment from MMC... OK
40Could not find supported display, disabling splash
41In:    serial
42Out:   serial
43Err:   serial
44Hit any key to stop autoboot:  0
45Boot splash disabled
4641368 bytes read in 125 ms (322.3 KiB/s)
476508000 bytes read in 428 ms (14.5 MiB/s)
48Kernel image @ 0x12000000 [ 0x000000 - 0x634de0 ]
49## Flattened Device Tree blob at 18000000
50Booting using the fdt blob at 0x18000000
51Using Device Tree in place at 18000000, end 1800d197
52
53Starting kernel ...
54
55Uncompressing Linux... done, booting the kernel.
56
57# ... a bunch of output snipped here for readability ...
58
59Starting User Application: OK
60
61Reach Technology FrameBuffer 2.7.4 imx6dl-g3-sd ttymxc0
62
63imx6dl-g3-sd login:

After the reboot, cd back to the USB stick directory and re-issue the mkemmc.sh command with the same arguments.

 1# to actually flash the u-boot and Linux images to eMMC
 2Reach Technology FrameBuffer 2.7.4 imx6dl-g3-sd ttymxc0
 3
 4imx6dl-g3-sd login: root
 5root@imx6dl-g3-sd:~# cd /run/media/sda1/B_2.2
 6root@imx6dl-g3-sd:/run/media/sda1/B_2.2# mkemmc.sh u-boot-imx6dl-g3-emmc-v2019.01+gitAUTOINC+7c81ebfabc-r0.imx reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg
 7
 8checking for eMMC partition at "/run/media/mmcblk3p1"
 9
10checking for eMMC partition at "/run/media/mmcblk3p2"
11
12checking for eMMC partition at "/run/media/mmcblk3p3"
13
14checking for eMMC partition at "/run/media/mmcblk3p4"
15
16flashing eMMC SD image "reach-image-qt5-imx6dl-g3-emmc-20200625182854.sdimg" to "/dev/mmcblk3"
173422552064 bytes (3.4 GB, 3.2 GiB) copied, 174 s, 19.7 MB/s
18409+1 records in
19409+1 records out
203438280704 bytes (3.4 GB, 3.2 GiB) copied, 181.88 s, 18.9 MB/s
21542+0 records in
22542+0 records out
23277504 bytes (278 kB, 271 KiB) copied, 0.197568 s, 1.4 MB/s
24
25setting up eMMC boot
26Changing ext_csd[BOOT_BUS_CONDITIONS] from 0x01 to 0x01
27
28The image has been flashed to eMMC.
291) Run "halt"
302) Power down the board
313) Insert the eMMC boot jumper
324) Power up the board
33
34root@imx6dl-g3-sd:/run/media/sda1/B_2.2#

Footnotes:

1

Images for boards with no TPM.

2

Images for boards with a TPM.

3

Mender is used for system updates. See the doc here.

4

Be sure to substitute the correct path to your USB stick.

5

The USB stick used in this example has Beta 2.1 and Beta 2.2 on it hence the subdir under /run/media/sda1.