IOT-GATE-IMX8PV2: U-Boot: Recovery

From Compulab Mediawiki
Jump to: navigation, search

Introduction

This article describes flashing U-Boot firmware image with a Linux Host using Universal Update Utility (hereinafter UUU).


Admolition note.png Follow the Universal Update Utility instructions to install and setup the UUU tool on a host Linux station.

Getting Recovery U-Boot Firmware Image

unzip iot-gate-imx8pv2_firmware-recovery-image_YYYY-MM-DD.zip -d /path/to/iot-gate-imx8pv2-firmware

Determining RAM size

Determine the correct DRAM size of the IOT-GATE-IMX8PV2 according to the label located on the bottom side of the device. DRAM size is encoded in the unit's D option.
Use the table below to determine DRAM_CONF value:

Product D Option DRAM Size (MB) DRAM_CONF
D1 1024 d1d8
D2 2048 d2d4
D4 4096 d2d4
D8 8192 d1d8


DRAM configuration is handled by the bootloader (SPL/U-Boot), and the relevant information is passed to the Linux kernel via the Device Tree.
In particular, the detected DRAM size, expressed in megabytes (MB), can be read from the file /proc/device-tree/som.info/dram.size.
The following commands can be used to determine the DRAM size on a running IOT-GATE-IMX8PV2 gateway:

  • DRAM size in megabytes (MB):
compulab@iot-gate-imx8pv2:~$ echo $(</proc/device-tree/som.info/dram.size)
  • DRAM size in gigabytes (GB):
compulab@iot-gate-imx8pv2:~$ echo $(( $(</proc/device-tree/som.info/dram.size) / 1024 ))

Flashing U-Boot Firmware

  • Power off the IOT-GATE-IMX8PV2 device.
  • Remove the Service bay door to access the USB programming port.
  • Connect the IOT-GATE-IMX8PV2 micro-USB connector with the workstation USB port using a standard micro-USB cable.
  • Power on the IOT-GATE-IMX8PV2 device via the main DC input.
  • Issue the following commands on the host Linux station:
uuu -lsusb
Expected output:
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.243-15-g0220e96

Connected Known USB Devices
        Path     Chip    Pro     Vid     Pid     BcdVersion      Serial_no
        ====================================================================
        1:132    MX865   SDPS:   0x1FC9 0x0146   0x0002  0D138800718FDB45
  • Flash U-Boot Firmware. Replace <DRAM_CONF> with the actual value:
sudo uuu -d -v -b emmc /path/to/iot-gate-imx8pv2-firmware/flash.bin.<DRAM_CONF>
  • Make sure the deployment is completed with no error

After Installation

  • Turn off the device
  • Disconnect the micro-USB cable from the device's programming port
  • Turn on the device
  • Press a key to prevent a possible autoboot and get into the U-Boot command prompt
  • Restore default boot environment, save it and reset device:
env default -a ; saveenv ; reset