Note that the installation procedure requires a bootable SD card that will be used for the initial boot. Refer to Booting Linux from SD card for information on how to create a bootable SD card. Note also that the procedure will erase all data previously present on the eMMC.
- Insert a bootable SD card into the Linux development host. Download the tarball with the prebuilt bootable Linux images from the Emcraft site, and unpack it into the /usr/local/mfg_images directory on the rootfs partition on the SD card:
$ sudo mkdir -p /media/emcraft/b8a8aa84-4c96-443e-8563-88a388f197ec/usr/
local/mfg_images
$ sudo tar xvfj images-imx8m-<version>.tar.bz2 -C /media/emcraft/b8a8aa84-
4c96-443e-8563-88a388f197ec/usr/local/mfg_images
Image
Image-imx8m-som.dtb
imx-boot-imx8m-som-sd.bin
imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin
modules-imx8m-som.tgz
emcraft-rootfs-imx8m-som.tar.bz2
$
- Unmount the SD card and use it for booting the i.MX 8M SOM. Refer to Booting Linux from SD card. Once the i.MX 8M SOM login prompt appears, login with the root user and an empty password.
- In the Linux command prompt unmount the eMMC (if it is mounted) in order to make sure it ready for the partitioning:
$ umount -f /dev/mmcblk0p1
$ umount -f /dev/mmcblk0p2
- Erase the previous partition table, which may be present if the eMMC was used for something before:
$ wipefs --all /dev/mmcblk0
- Install the U-Boot image file (imx-boot-imx8m-som-sd.bin) to the eMMC starting at the 33KB offset. Note that you need to specify the whole device as the destination for the dd command (i.e. do not install the image to a partition):
$ dd if=/usr/local/mfg_images/imx-boot-imx8m-som-sd.bin of=/dev/mmcblk0
bs=1k seek=33
- Flush the system caches:
$ sync
- Create a partition table on the eMMC, as follows (note the offset of 9000 sectors before the first partition):
$ echo -ne "9000 128M 83\n262145 + 83\n" | /usr/sbin/sfdisk /dev/mmcblk0
- Create the filesystems on the eMMC:
$ umount /dev/mmcblk0p1
$ umount /dev/mmcblk0p2
$ mkfs.vfat /dev/mmcblk0p1
$ mkfs.ext4 -F /dev/mmcblk0p2
- Mount the eMMC partitions:
$ mkdir -p /mnt/mmcblk0p1
$ mkdir -p /mnt/mmcblk0p2
$ mount /dev/mmcblk0p1 /mnt/mmcblk0p1
$ mount /dev/mmcblk0p2 /mnt/mmcblk0p2
- Copy the Linux kernel, DTB and Cortex-M4 demo images to the first (VFAT) eMMC partition:
$ cp /usr/local/mfg_images/{Image,Image-imx8m-som.dtb,imx8mq_m4_TCM_rpmsg
_lite_str_echo_rtos.bin} /mnt/mmcblk0p1
- Install the root filesystem to the ext4 SD Card partition:
$ tar xfj /usr/local/mfg_images/emcraft-rootfs-imx8m-som.tar.bz2 -C
/mnt/mmcblk0p2
- Flush the system caches and umount the eMMC partitions:
$ sync
$ umount /dev/mmcblk0p1
$ umount /dev/mmcblk0p2
- The eMMC is now ready for booting. Remove the SD card from the slot, power off the IMX8M-SOM-BSB board, and prepare it for booting from the eMMC by setting the S1 DIP switch boot selection jumpers as follows:
S1.1 |
Off |
S1.2 |
On |
S1.3 |
Off |
S1.4 |
Off |
S1.5 |
Off |
S1.6 |
Off |
S1.7 |
On |
S1.8 |
Off |
|
|
- Re-apply the power. The system will boot to the Linux login prompt:
U-Boot SPL 2017.03-imx_v2017.03_4.9.51_imx8m_beta (Feb 04 2018 - 22:09:01)
DDR PLL1 400MHz locked
DDR PLL1 395MHz locked
Normal Boot
Trying to boot from MMC1
U-Boot 2017.03-imx_v2017.03_4.9.51_imx8m_beta (Feb 04 2018 - 22:09:01 +0300)
CPU: Freescale i.MX8MQ rev2.0 1500 MHz (running at 1000 MHz)
CPU: Commercial temperature grade (0C to 95C) at 32C
Reset cause: POR
Model: EmCraft i.MX8M SOM LPDDR4
DRAM: 1 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@30be0000
Normal Boot
Hit any key to stop autoboot: 0
...
NXP i.MX Release Distro 4.9.51-mx8-beta imx8m-som ttymxc0
imx8m-som login: root
...