Skip to content

Getting Started with i.MX8M Plus

This guide is intended for first time users of the i.MX8M Plus Development Kit and provides help in getting the board up and running. Each Development Kit includes an i.MX8M Plus board and accessories like a power supply and a USB-to-Serial converter.

Setup Method

Besides the initial start, this guide will later on focus on setting up or updating the device via SD Card. This is a proven and reliable method of working with the device. The serial downloader mode and the NXP uuu tool are not part of this guide. It has many pitfalls which are impossible to cover in this guide. However for anyone interested in this tool, have a look here.

Required Items

Some parts of this guide require additional items in order for the tasks to work.

  • USB-Stick min. 8 GB FAT32 formatted
  • SD-Card 8 GB or larger
  • SD-Card image (*.wic) from our release page (see under Assets -> Other) or from the users Yocto deploy folder
  • flash.bin Bootloader image from our release page (see under Assets -> Other) or from the users Yocto deploy folder

bl-imx8mp-top

Layout and Connectors

BL-i.MX8MP-Connectors-Layout

Most notable connectors and interfaces touched on by this guide:

  • X101 - Power, connector for the power supply 24 V
  • X201 - Konsole (engl.: console), connector for the serial debug console
  • X601 - SD-Karte (engl.: SD Card), SD Card slot for storing data. Booting external operating systems is only possible in recovery mode.
  • S1 - Force Recovery Switch to force booting from SD Card

Connecting Power and Debug Cable

Connect the power supply that came with the Development Kit and plug it into the X101 (Power) socket on the board. Do not connect the power supply adapter to the mains yet. The power socket on the board is on the left next to the two USB ports and has only two pins.

Now take the USB cable from the box and plug the USB-Mini plug into the USB-Mini socket, named X201 (Konsole), at the side of the board next to the HDMI port. This connector is not really a USB port, but rather a serial port which allows the user access to UART 3 (Debug Console) and to communicate with the operating system later on without the need for a network setup. The other end of the cable (USB type A) has to be plugged into the USB-to-Serial adapter which came with the Development Kit. The other end of the USB-to-Serial adapter can now be plugged into a computer.

bl-imx8mp-top-debug-dongle

First Start

Before turning on the power for the BL i.MX8M Plus, make sure the USB-to-Serial adapter is plugged into the computer and that you have a terminal or console program running on the COM port the USB-to-Serial adapter is registered at. In Linux this will usually be a ttyUSB and in Windows a COM port device. The serial settings should be 115200 8N1.

Once this is set up, the board can be powered on and text should appear in the terminal program, which means the operating system is starting. After a short wait the text output should stop and a login prompt is visible. The image below shows an example what should be shown in the terminal program.

BL-i.MX8MP-Terminal-Wnd-Login

To log in use the user root and depending on the OS configuration usually no password is needed, but if the system is asking for one, the password is root by default. Once logged in there are many things that can be done with the system, but for a start why not try to turn the digital output 1 (DIO1) on and off. The pre-installed system should have the libgpiod library and its service programs already installed, this means we can use a program called gpioset to change the state of DIO1.

For more information on this topic, see the "Main Documentation" here or see "KED i.MX8M Plus Products" page for i.MX8M Plus based boards.

Configure DIO1 as an output and setting it to 1 (On).

root@kontron-mx8mp:/# gpioset gpiochip5 0=1

The onboard LED for DIO1 should light up and signal that its output is now active. With this one command the DIO1's corresponding GPIO was configured as an output and then set to 1 in one go.

Turning DIO1 off can be done by simply setting it to 0 with the following command:

root@kontron-mx8mp:/# gpioset gpiochip5 0=0

The LED for DIO1 should now be off again, meaning the output is no longer active.

This concludes the getting started guide for the BL i.MX8M Plus board. As mentioned above, also see other sections of this online documentation to learn more about other connection and communication options and how to setup your own Yocto Linux build system to create your own OS.

Troubleshooting

The BL i.MX8M Plus board in the Development Kit should have an OS pre-installed on the internal eMMC memory and is ready to go. If this is not the case or you just have the BL i.MX8M Plus board, you can still get the board working by making an SD card with a pre-build image from our server and setting the Force Recovery switch S1 to ON.

Download one of the reference images from the KED BSP release page to get a base system. Unpack the release file and then unpack and write the *.wic file onto a blank SD card. If you are working under Windows, you might have to rename the file extension from *.wic to *.img to be able to use one of the many SD card writing programs available. Insert the SD card into the BL i.MX8M Plus boards SD card slot and plug in the power supply. The board should now boot from the SD card automatically and the above mentioned text should appear in the terminal program. You should now be able to log in and try the GPIO example above.

Note: While the Force Recovery switch S1 is active, the device can only boot from SD Card, the eMMC is ignored.

Building your own system

If you want to build your own system for the BL i.MX8M Plus, you have to use the Yocto based build system to create your own system image. Please follow the KED Yocto BSP guide to setup and build your own system. For more information on the Yocto Project visit the projects website where you also find the reference manual.

After you have obtained or build a Yocto image, you can proceed to write this image onto a SD Card and then setup the device or overwrite any existing OS with your own system.

About SD Card Images and eMMC

The SD Card images produced by the Yocto build system are usually not able to boot directly from eMMC without further changes. See this guide further down on how to write the SD card image to eMMC and make it bootable.

Writing the Bootloader to eMMC

This section is intended for users who have a single BL i.MX8M Plus and not the Demo Kit and want to be able to boot the device from eMMC memory instead, freeing up the SD card for other uses. To boot the BL i.MX8M Plus from eMMC a bootloader stored in the eMMC boot section of the SoM is needed, like U-Boot. In addition the bootconfig has to be set to boot from eMMC.

Required Files

  • image.wic – SD card image from Yocto for SD card, usually found in the deploy folder after a successful build.
  • flash.bin – Bootloader for eMMC boot partition, usually found in the Yocto deploy folder after a successful build.

Preparations

Now that you have the files, a few more steps are needed before you can write the bootloader to the eMMC of the BL i.MX8M Plus.

  • Insert an SD card into the computer using a card reader.
  • Write the image.wic to the SD card using an SD card writing program of your choice.
  • Once done, re-insert the SD card into the PC and copy the flash.bin file to the FAT32 partition, there should be only one other file named fitImage.
  • Set the S1 Force Recovery switch on the BL i.MX8M Plus to ON

Writing the Bootloader

Everything has been prepared, now you can write the U-Boot file to the eMMC boot section of the BL i.MX8M Plus.

  • Insert the SD card into the BL i.MX8M Plus and have the serial console ready to watch the system boot.
  • Once the login prompt appears, enter the username root and if the system asks for a password enter root again as password.
  • After logging in, run the command lsblk and see if the first partition of the SD card is already mounted. If not, mount the boot partition to a folder of your choice and change to this location.
  • look for mmcblk1p1 and if its mounted at: /run/media/mmcblk1p1

  • Then try to run the following commands to install or update the bootloader:

    root@mx8mp:~# cd /run/media/mmcblk1p1
    root@mx8mp:~# mmc bootpart enable 1 0 /dev/mmcblk0
    root@mx8mp:~# echo 0 > /sys/block/mmcblk0boot0/force_ro
    root@mx8mp:~# dd if=flash.bin of=/dev/mmcblk0boot0 bs=1K
    root@mx8mp:~# sync
    root@mx8mp:~# echo 1 > /sys/block/mmcblk0boot0/force_ro

The bootloader should now be stored in the first boot area of the eMMC. If you power off the device now, take out the SD card, set the Force Recovery switch S1 to OFF and power the device back on, the bootloader stored on the eMMC should be loaded and show up in the debug console.

If a system is already present on the eMMC, it will be started. If there is no OS on the eMMC, the bootloader will try to load the kernel image, but fails and then resets and starts over in an endless loop.

Writing the System Image to eMMC Memory

The BL i.MX8M Plus has an eMMC memory chip on the SoM, which can be used to boot a self made System Image and in the process freeing up the SD card slot which can then be used as data storage for example.

No OS

If you received the BL i.MX8M Plus in a Development Kit, then you should be good to go and you can go to the top of this guide and follow the steps there to get the device up and running. If you received or bought the BL i.MX8M Plus standalone, there is probably no operating system installed on the eMMC for testing. In this case make sure you have completed the previous section fist, or the device will not boot after this.

Requirements

  • image.wic – SD card image from Yocto, usually found in the deploy folder after a successful build.
  • USB-Stick FAT32 formatted containing the above mentioned image.wic file.

Preparations

If you come from the previous section, you can re-use the SD card, if not then you will first have to prepare an SD card before continuing with the next steps.

  • Insert an SD card into the computer using a card reader.
  • Write the image.wic to the SD card using an SD card writing program of your choice.
  • Copy the image.wic file to the root of the USB stick.
  • Set the S1 Force Recovery switch on the BL i.MX8M Plus to ON

Writing the System Image to eMMC Memory

Everything has been prepared, now you can write the System Image file to the eMMC of the BL i.MX8M Plus.

  • Insert the SD card into the BL i.MX8M Plus as well as the USB stick and have the serial console ready to watch the system boot.
  • Once the login prompt appears, enter the username root and if the system asks for a password enter root again as password.
  • After logging in, run the command lsblk and see if the USB stick was automatically mounted. If not, mount the root partition of the stick to a folder of your choice and change to its location.
  • look for sda and if its mounted at: /run/media/sda1

In this example the USB stick was detected during boot and the first partition of the media was mounted to "/run/media/sda1". Navigating in to this folder and listing the available files should show the System Image (*.wic) file. If the mount point is different on your device, adjust the following commands accordingly.

root@mx8mp:~# cd /run/media/sda1
root@mx8mp:/run/media/sda1# ls -la
drwxrwx---    2 root     disk         32768 Jan  1  1970 .
drwxr-xr-x    5 root     root           100 Sep  1 09:08 ..
-rwxrwx---    1 root     disk     465599488 Aug 18 12:20 image.wic

You can now write the System Image to the eMMC memory using the program dd and the device name /dev/mmcblk0:

root@mx8mp:~# dd if=image.wic of=/dev/mmcblk0 bs=1M conv=sync

Now wait for a few minutes until the complete image has been transferred. Once this is done, dd will print out the amount of blocks read and written and you are back at the command prompt.

This is however not enough to have a bootable system, a few more steps are needed at this point to make the system work. The following steps are also needed:

root@mx8mp:~# mkdir /mnt/boot
root@mx8mp:~# mount /dev/mmcblk0p1 /mnt/boot/
root@mx8mp:~# cp /mnt/boot/fitImage /mnt/boot/fitImage_A
root@mx8mp:~# cp /mnt/boot/fitImage /mnt/boot/fitImage_B

Also a file called sys_active is need and has to have only 2 letters as content, "AB" and nothing else.

  • While in /mnt/boot

    • nano sys_active
    • Enter the letters: AB

    bl-imx8mp-sys_active-file

    • then press Ctrl+O and then Enter to save the file
    • then press Ctrl+X to leave the nano editor
    • The directory listing should show 4 files are now present in the FAT32 partition on the eMMC

    bl-imx8mp-listing-emmc-fat32

Now power off the device unplug the USB stick, take out the SD card and set the Force Recovery switch S1 to OFF, then reboot the BL i.MX8M Plus to see if now the systems boots from eMMC.

Troubleshooting

If nothing happens and the BL i.MX8M Plus does not boot from eMMC, then probably the eMMC is not programed with a bootloader or the bootconfiguration fuses do not have the correct settings. Boot the BL i.MX8M Plus again from SD card (Force Recovery switch S1 must be ON) and follow the steps again.