Burn a MicroSD card with the Yocto image that we built in A first Yocto build for the NXP i. MX 8M Quad EVK
Note that this is the easy method that does not use the full space of the MicroSD card.
This project assumes that you have successfully completed the project A first Yocto build for the NXP i. MX 8M Quad EVK and you are now ready to burn your MicroSD card with the image that Yocto built for you.
Prepare the imageOnce the build has completed, the output images will be located here:
./Yocto/imx8mmevk-fscl-wayland-imx-image-core/tmp/deploy/images/imx8mmevk/
To identify the SD card image, use this command
$ ls | grep .wic.bz2
There should be two results, one is the image with the date/time stamp, the other is a soft link
imx-image-core-imx8mmevk-20201210005646.rootfs.wic.bz2
imx-image-core-imx8mmevk.wic.bz2 -> imx-image-core-imx8mmevk-20201210005646.rootfs.wic.bz2
Unzip the bz2 file (I am relying on the softlink for the name):
$ bunzip2 -dk -f imx-image-core-imx8mmevk.wic.bz2
The unzipped file should be called imx-image-core-imx8mmevk.wic
Insert a MicroSD card in to your computer or use a USB adapater, and then insert this adapter in to the PC USB port.
$ dmesg
Look at the last few lines from the above command to see which device name has been applied, in my case it is sdg meaning device /dev/sdg
Burn the image on to the uSD cardWARNING: BE EXTREMELY CAREFUL THAT YOU GET THE DEVICE NAME RIGHT OR ELSE YOU RISK OVERWRITING ANOTHER DISK (I have done this a few times)
ProTip: Always write out your dd commands in a text editor and copy them to the terminal when you are certain they are correct.
$ sudo dd if=imx-image-core-imx8mmevk.wic of=/dev/sdg bs=4K conv=fsync status=progress
The above will take anywhere from 30 seconds to a few minutes depending on the speed of your MicroSD card.
In case the OS already mounted the MicroSD card, unmount it
$ sudo umount /dev/sdg1
Put the MicroSD in to the EVK, configure the EVK DIP switches for MicroSD boot, connect up the console cable, power on the EVK
From the console we can observe the EVK boot, there are a few lines that are critical for confirming that the EVK is booting the image we just built
1 SPL
U-Boot SPL 2020.04-5.4.47-2.2.0+gffc3fbe7e5 (Dec 10 2020 - 02:21:49 +0000)
2 U-Boot
U-Boot 2020.04-5.4.47-2.2.0+gffc3fbe7e5 (Dec 10 2020 - 02:21:49 +0000)
3 Kernel
[ 0.000000] Linux version 5.4.47-2.2.0+g5ec03d06f54e (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Thu Dec 10 01:25:56 UTC 2020
Login as root, no password
Additional InformationMicroSD partition information using fdisk
$ sudo fdisk /dev/sdg
Results
Device Boot Start End Sectors Size Id Type
/dev/sdg1 * 16384 186775 170392 83.2M c W95 FAT32 (LBA)
/dev/sdg2 196608 1945393 1748786 853.9M 83 Linux
MicroSD partition information using gdisk
$ sudo gdisk -l /dev/sdg
Results
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Number Start (sector) End (sector) Size Code Name
1 16384 186775 83.2 MiB 0700 Microsoft basic data
2 196608 1945393 853.9 MiB 8300 Linux filesystem
Contents of the boot partition
Permissions Links Size User Group Date Modified Name
.rw-r--r-- 1 26Mi flint flint 9 Dec 19:19 Image
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-ddr4-evk-pcie-ep.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-ddr4-evk-revb-rm67191.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-ddr4-evk-revb.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-ddr4-evk-rm67191.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-ddr4-evk.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-evk-8mic-revE.dtb
.rw-r--r-- 1 46Ki flint flint 9 Dec 19:19 imx8mm-evk-8mic-swpdm.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-ak4497.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-ak5558.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-audio-tdm.dtb
.rw-r--r-- 1 3.0Ki flint flint 9 Dec 19:19 imx8mm-evk-inmate.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-pcie-ep.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-revb.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-rm67191.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-root.dtb
.rw-r--r-- 1 45Ki flint flint 9 Dec 19:19 imx8mm-evk-rpmsg.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk-usd-wifi.dtb
.rw-r--r-- 1 44Ki flint flint 9 Dec 19:19 imx8mm-evk.dtb
.rw-r--r-- 1 6.2Ki flint flint 9 Dec 19:19 imx8mm_m4_TCM_hello_world.bin
.rw-r--r-- 1 16Ki flint flint 9 Dec 19:19 imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
.rw-r--r-- 1 16Ki flint flint 9 Dec 19:19 imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin
.rw-r--r-- 1 39Ki flint flint 9 Dec 19:19 imx8mm_m4_TCM_sai_low_power_audio.bin
.rw-r--r-- 1 2.0Mi flint flint 9 Dec 19:19 tee.bin
Contents of the root file system
Permissions Links Size User Group Date Modified Name
drwxr-xr-x 2 - root root 9 Dec 19:18 bin
drwxr-xr-x 2 - root root 9 Dec 19:16 boot
drwxr-xr-x 2 - root root 9 Dec 17:34 dev
drwxr-xr-x 45 - root root 9 Dec 17:09 etc
drwxr-xr-x 3 - root root 9 Dec 19:16 home
drwxr-xr-x 11 - root root 9 Dec 19:17 lib
drwx------ 2 - root root 9 Dec 19:19 lost+found
drwxr-xr-x 2 - root root 9 Dec 17:34 media
drwxr-xr-x 2 - root root 9 Dec 17:34 mnt
drwxr-xr-x 3 - root root 9 Dec 19:17 opt
dr-xr-xr-x 2 - root root 9 Dec 17:34 proc
drwxr-xr-x 2 - root root 9 Dec 17:34 run
drwxr-xr-x 3 - root root 9 Dec 19:18 sbin
dr-xr-xr-x 2 - root root 9 Dec 17:34 sys
drwxrwxrwt 2 - root root 9 Dec 17:34 tmp
drwxr-xr-x 39 - root root 9 Dec 19:16 unit_tests
drwxr-xr-x 11 - root root 9 Dec 19:16 usr
drwxr-xr-x 8 - root root 9 Dec 17:09 var
Comments
Please log in or sign up to comment.