Flashing Guide for Yocto OS on I-Pi SMARC RB5

This document provides detailed information on flashing Yocto OS on the I-Pi SMARC RB5.

Prerequisites

  • To flash the OS on the I-Pi SMARC RB5, you need a host PC with Ubuntu Desktop (20.04)
  • Download the prebuilt Yocto image files by clicking here.

EDL Mode

To initiate the flashing process for the Yocto image, it is essential to first transition the module into Emergency Download (EDL) mode.

1. Micro USB.

2. Power jack.

3. UART Pins (See How to Read Console Output).

4. F_DL button (requires removal of the heatsink).

5. Follow the steps below to enter into EDL mode.

​ Press the F_DL Key Button on the module.

​ Hold the F_DL Key Button and power on the module by connecting the power cable.

​ Release the F_DL Key Button and connect the Micro USB cable.

Flashing NON-HLOS ( Non-High Level Operating System) (QDL, Linux) on Module

Image path: prebuild-image/LEC-RB5-8G-YOCTO-XX-XX/LEC-RB5-8G-NON-HLOS-YOCTO-XX-XX.zip

Using an open-source tool called Qualcomm Download (QDL), with which we can flash the Non-HLOS firmware.

Install using the commands below.

snap install qdl
sudo apt-get -y install libudev-dev

Note: If you prefer to compile the QDL software, the source can be found on the Linaro website: https://git.codelinaro.org/linaro/qcomlt/qdl (optional)

Unzip file prebuild-image/LEC-RB5-8G-YOCTO-XX-XX/LEC-RB5-8G-NON-HLOS-YOCTO-XX-XX/ufs.zip

  1. Open a terminal and navigate to the prebuild-image/LEC-RB5-8G-YOCTO-XX-XX/LEC-RB5-8G-NON-HLOS-YOCTO-XX-XX/ufs folder inside the NON-HLOS folder.
  2. Make sure the device is in EDL mode.
  3. Flash software using the following command:
sudo qdl --include ./ --storage ufs ./prog_firehose_ddr.elf rawprogram*.xml patch*.xml
  1. Remove the power cable and micro USB cable

  2. Plug in the micro USB cable before plugging the power cable back in (Don’t press F_DL Key). Your device should now boot into the Fastboot mode.

  3. The serial console output displays the messages below on entering Fastboot mode.

Note: If target LEC-RB5 already has the HLOS image installed, module will boot into Yocto OS instead of Fastboot mode.

For such cases, please refer to the Fastboot mode section below.

Fastboot mode

After Yocto OS boots, run the command below on the target to enter Fastboot mode.

su
/etc/fastboot.sh

Module will reset and enter into Fastboot mode.

Flashing HLOS (High Level Operating System) on Module (ADB)

To flash prebuilt image from the provided package refer to the section “Flashing Pre-build image”

To flash the Yocto build image, refer to the section “Flashing Yocto build image”

After entering into Fastboot mode, we will flash the HLOS image using Fastboot commands.

sudo apt-get -y install img2simg gzip
sudo apt-get -y install android-tools-adb android-tools-fastboot

Flashing Pre-build image:

Image path: prebuild-image/LEC-RB5-8G-YOCTO-XX-XX/LEC-RB5-8G-HLOS-YOCTO-XX-XX.zip

  1. With micro USB cable connected to target. On host PC, check if the module is detected using Fastboot

    sudo fastboot devices -l
  2. Flash EDK2 , File system, Kernel image and file system

    sudo fastboot flash boot_a qti-yocto-robotics-image-qrb5165-rb5-boot.img
    sudo fastboot flash boot_b qti-yocto-robotics-image-qrb5165-rb5-boot.img
    sudo fastboot flash system qti-yocto-robotics-image-qrb5165-rb5-sysfs.ext4
    sudo fastboot flash abl_a abl.elf
    sudo fastboot flash abl_b abl.elf
  3. Reset the module

    sudo fastboot reboot

    Module will reset and boot into Yocto OS. We can get the display over HDMI.

Note: To enter into Fastboot mode, refer to the section Fastboot mode

Flashing Yocto build image:

For building the Yocto image, refer: clicking here.

After a successful build, output files can be found in path build-rpb-wayland/tmp-rpb_wayland-glibc/deploy/images/lec-rb5

  1. Decompress image :

    gzip -fdk rpb-weston-image-lec-rb5.ext4.gz
  2. Convert the decompressed image:

    img2simg rpb-weston-image-lec-rb5.ext4 qti-yocto-robotics-image-qrb5165-rb5-sysfs.ext4
  3. Check if module is detected using Fastboot.

    sudo fastboot devices -l
  4. Flash kernel image and file system.

    sudo fastboot flash boot_a boot-lec-rb5.img
    sudo fastboot flash boot_b boot-lec-rb5.img
    sudo fastboot flash system qti-yocto-robotics-image-qrb5165-rb5-sysfs.ext4
  5. Copy EDK2 image from “prebuild-image/LEC-RB5-8G-YOCTO-XX-XX/LEC-RB5-8G-HLOS-YOCTO-XX-XX/ufs/abl.elf“ to current directory. Then, flash the EDK2 using the commands below.

    sudo fastboot flash abl_a abl.elf
    sudo fastboot flash abl_b abl.elf
  6. Reset the module.

    sudo fastboot reboot

​ Module will reset and boot into Yocto OS with display over HDMI.

Note: To enter into Fastboot mode, refer to the section Fastboot mode