Booting Linux from SD Card Print

 

Use the procedure documented below to install the U-Boot firmware, Linux kernel and filesystem images to an SD Card on the i.MX 8M module. Having completed the installation, the i.MX 8M SOM will boot to Linux from the SD Card on next reset / power on.

Please note that the installation will erase files previously installed on your SD Card. The SD card size should be at least 8 Gb for the Linux kernel and filesystem images to fit on the card.

Here is the procedure:

  1. Download and unpack the tarball with the prebuilt bootable Linux images from the Emcraft site:
  2. $ tar xvfj images-imx8m-beta6.tar.bz2 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 $

  3. Insert an empty SD Card into development host. Install the U-Boot image file (imx-boot-imx8m-som-sd.bin) to the SD Card starting at 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):
  4. $ sudo dd if=imx-boot-imx8m-som-sd.bin of=/dev/sdd bs=1k seek=33 ...

  5. Flush the system caches:
  6. sync

  7. Re-create the partitions on the SD Card, as follows (note the offset of 9000 sectors before the first partition):
  8. $ sudo fdisk -l /dev/sdd Disk /dev/sdd: 15.6 GB, 15552479232 bytes 64 heads, 32 sectors/track, 14832 cylinders, total 30375936 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x423e3293 Device Boot Start End Blocks Id System /dev/sdd1 9000 657143 396929 c W95 FAT32 (LBA) /dev/sdd2 657144 6947599 3145728 83 Linux $

  9. Create the filesystems on the SD Card:
  10. $ sudo mkfs.vfat /dev/sdd1
    $ sudo mkfs.ext4 /dev/sdd2

  11. Re-insert the SD Card into you host PC, so the system discovers the new partitions and mounts them. Copy the Linux kernel, DTB and Cortex-M4 demo images to the first (VFAT) partition:
  12. $ df ... /dev/sdd1 324824 38928 285896 12% /media/emcraft/13B4-D0A1 /dev/sdd2 4062520 2068732 1767712 54% /media/emcraft/ b8a8aa84-4c96-443e-8563-88a388f197ec ... $ cp Image Image-imx8m-som.dtb imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.bin \ /media/emcraft/13B4-D0A1/

  13. Install the root filesystem to the ext4 SD Card partition:
  14. $ cd /media/emcraft/b8a8aa84-4c96-443e-8563-88a388f197ec $ sudo tar xfj /tmp/emcraft-rootfs-imx8m-som.tar.bz2 $ cd - $ umount /media/emcraft/*

  15. Insert the SD Card to the SD Card holder on the IMX8M-SOM-BSB board. Configure the board for booting from the SD Card. Set the S1 DIP switch boot selection jumpers as follows:

  16. S1.1 Off
    S1.2 On
    S1.3 Off
    S1.4 Off
    S1.5 On
    S1.6 On
    S1.7 Off
    S1.8 Off

     

  17. Re-apply the power. The system will boot to the Linux prompt:
  18. 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 MMC2

    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
    ...

Troubleshooting

If the target board does not boot (no activity on the console), verify the following items:

  1. If the SD Card was programmed on a virtual machine (e.g. VmWare), program the SD Card on a native Linux PC.
  2. Verify that the power LED D5 switch lits up when you power-on the board.
  3. Verify that all S1 switches are set to the positions described above.
  4. If suggestions above do not help, please contact Emcraft at This e-mail address is being protected from spambots. You need JavaScript enabled to view it to provide us with the following materials:
    • Photo of your IMX8M-SOM-BSB board (a top-side view with jumpers);
    • Full log of the U-Boot build, SD preparation and installation procedures;
    • The U-Boot binary ready for installing onto SD Card.