Install Balena OS to Compulab IMX8PLUS

I have some problems installing balena on the Compulab IMX8PLUS.
I followed these instructions:

the process, whenever I reboot the board, the boot sequence doesn’t start.
Only after I use the ‘sudo uuu imx-boot4g’ command, the board is up and running.

I think it may relate to point number 6 in the instructions:
“The binary should be written at offset 0”
I am using windows PC and the ums command mount new disk, and I just copied the file into this disk.

Do you have any solutions for me?

Thank you in advance.

Hi, sorry for the delay. How are you programming the bin-flash_evk binary? Are you using Etcher?

Also now when I tried to run:
iot-gate-imx8plus=> ums 0 mmc 2.1
I get:
** Invalid partition 1 **

Hi @Yosef ,

Before you’ve copied the file to the disk, did the command ums 0 mmc 2.1 work fine?

If it did, can you please try to erase the hw boot partition from u-boot with the following commands:

iot-gate-imx8plus=> mmc dev 2
iot-gate-imx8plus=> mmc erase 2 0x2BF66

Afterwards mount the partition again:

ums 0 mmc 2.1

and if it no longer throws an error, try to write the binary imx-boot-iot-gate-imx8plus-sd.bin-flash_evk using Etcher. On my Linux system, Etcher provides the following name for the IOT-GATE’s boot partition mounted by ums: Linux UMS disk 0 and it writes the imx-boot-flash_evk binary at offset 0.

1 Like

Before it did work.
I did what you said, but I’m still getting the same error:

iot-gate-imx8plus=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
iot-gate-imx8plus=> mmc erase 2 0x2BF66

MMC erase: dev # 2, block # 2, count 180070 ...

Caution! Your devices Erase group is 0x400
The erase range would be change to 0x0~0x2bfff

180070 blocks erased: OK
iot-gate-imx8plus=> ums 0 mmc 2.1
** Invalid partition 1 **

Good, thanks for confirming.

If you’re not entering the flashing procedure, the device no longer loads u-boot nor does it load the Compulab operating system, right?

If so, please re-flash the Compulab Yocto image and see if ums works afterwards. Once it works fine, please use Etcher or dd to write the bootloader and don’t allow Windows to create any filesystem on the boot partition if prompted.

Did you get the chance to re-flash the device with the Compulab OS @Yosef ? Does ums work afterwards?

Hey, I haven’t managed to re-flash yet, I’m having a problem accessing the GRUB menu.
I am in contact with Compulab about that and I’m trying to fix it.

I spoke with Compulab, and they informed me that:
Balena does change U-Boot and disables possibility to update it for security reasons, so missing functionality makes sense.
Currenty they run bootcmd, not grub.
I believe you should check this with Balena team.
Could you please guide me on how to revert it back to Grub?

@Yosef I suspect that writing the Compulab u-boot might be sufficient to use ums again on the boot partition, and the steps in IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: U-Boot: Recovery - Compulab Mediawiki would recover that partition and write the Compulab u-boot in it. Please let me know if these steps allow you to use ums again, and if they do, there’s no need to get to grub any further or write the reference OS.

@acostach I did that it didn’t change anything

@acostach Do you know how can I revert it back to Grub?

@Yosef below are the steps I performed on my board to get to Grub and run the Compulab Debian reference image. Prior to this the board was flashed with balenaOS.

  1. Flashed Compulab u-boot by following these steps: IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: U-Boot: Recovery - Compulab Mediawiki

After Compulab u-boot was flashed, I disconnected the device’s programming port from the host PC and powered off the IOT-GATE-iMX8PLUS.

  1. Downloaded the IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS Debian Linux image and wrote it on a USB stick as per the docs at IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: Debian Linux: Installation - Compulab Mediawiki

  2. Inserted the newly flashed USB stick in the IOT-GATE-iMX8PLUS and powered on the device. The Compulab u-boot flashed at step 1) automatically ran Grub from the USB stick created at step 2)
    In the Grub menu I could choose the 3rd item which ran the Compulab image installer. The Compulab image installer flashed the eMMC with the Debian image.

Let me know if these steps work for you and if you are able to expose the u-boot partition from u-boot with ums after you re-flashed both Compulab u-boot and the Compulab reference image on the device.

Hello @Yosef did you solve your issues following the previous instructions?


@acostach @mpous
It didn’t help. I followed these steps:

  1. Flashed Compulab u-boot. Here are the logs:
yosef@Debian:~/Downloads$ uuu -lsusb
uuu (Universal Update Utility) for nxp imx chips -- lib1.4.77

Connected Known USB Devices
Path Chip Pro Vid Pid BcdVersion
1:1 MX865 SDPS: 0x1FC9 0x0146 0x0002

yosef@Debian:~/Downloads$ sudo uuu -v -b emmc flash.bin.d2d4
[sudo] password for yosef:
uuu (Universal Update Utility) for nxp imx chips -- lib1.4.77

Build in config:
Pctl Chip Vid Pid BcdVersion
SDPS: MX8QXP 0x1fc9 0x012f [0x0002..0xffff]
SDPS: MX8QM 0x1fc9 0x0129 [0x0002..0xffff]
SDPS: MX8DXL 0x1fc9 0x0147
SDPS: MX28 0x15a2 0x004f
SDPS: MX815 0x1fc9 0x013e
SDPS: MX865 0x1fc9 0x0146
SDPS: MX8ULP 0x1fc9 0x014a
SDPS: MX8ULP 0x1fc9 0x014b
SDP: MX7D 0x15a2 0x0076
SDP: MX6Q 0x15a2 0x0054
SDP: MX6D 0x15a2 0x0061
SDP: MX6SL 0x15a2 0x0063
SDP: MX6SX 0x15a2 0x0071
SDP: MX6UL 0x15a2 0x007d
SDP: MX6ULL 0x15a2 0x0080
SDP: MX6SLL 0x1fc9 0x0128
SDP: MX7ULP 0x1fc9 0x0126
SDP: MXRT106X 0x1fc9 0x0135
SDP: MX8MM 0x1fc9 0x0134
SDP: MX8MQ 0x1fc9 0x012b
SDPU: SPL 0x0525 0xb4a4 [0x0000..0x04ff]
SDPV: SPL1 0x0525 0xb4a4 [0x0500..0x9998]
SDPU: SPL 0x0525 0xb4a4 [0x9999..0x9999]
SDPU: SPL 0x3016 0x1001 [0x0000..0x04ff]
SDPV: SPL1 0x3016 0x1001 [0x0500..0x9998]
FBK: 0x066f 0x9afe
FBK: 0x066f 0x9bff
FB: 0x0525 0xa4a5
FB: 0x18d1 0x0d02
FB: 0x3016 0x0001

Run built-in script:
uuu_version 1.2.39

# @flash.bin.d2d4            | bootloader
# @flash.bin.d2d4   [flash.bin.d2d4] | image burn to emmc, default is the same as bootloader

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f flash.bin.d2d4

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f flash.bin.d2d4

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f flash.bin.d2d4 -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f flash.bin.d2d4 -skipspl
SDPV: jump
# }

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash bootloader flash.bin.d2d4
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: Done

Wait for Known USB Device Appear...
New USB Device Attached at 1:1
1:1>Start Cmd:SDPS: boot -f flash.bin.d2d4
99%1:1>Okay (4.794s)
  1. Wrote the image to the USB stick. Here are the logs:
unzip -p | sudo dd of=/dev/sdb1 bs=1M status=progress conv=fsync

3367960576 bytes (3.4 GB, 3.1 GiB) copied, 643 s, 5.2 MB/s 

0+51392 records in

0+51392 records out

3368026112 bytes (3.4 GB, 3.1 GiB) copied, 913.467 s, 3.7 MB/s
  1. Turned off the device
  2. Disconnected the PROG cable
  3. Connected the USB3.0
  4. Turned on the device

After completing these steps, nothing happened, and the device is stuck.

@Yosef I see, thanks for sharing the results. Something is wrong either with the reference image provisioning steps or with the device. They work on our side but not on yours so I opened this github issue in the Compulab repository and asked on your behalf about this problem you encounter.

It would also be great if you could let Compulab support know that flashing the reference recovery u-boot succeeds but u-boot still isn’t loaded on eMMC boot on that unit.

1 Like


Just walked through the process of getting Grub and running the Compulab Debian reference image on my IOT-GATE-iMX8PLUS. Previously had balenaOS on it. Followed the steps from Compulab Mediawiki. After flashing the eMMC with the Debian image via the Compulab installer, everything seems smooth.

If anyone’s tried the same, did you manage to expose the u-boot partition from u-boot with ums after re-flashing? Eager to know if you had a similar experience.


@Yosef could you please check if using emmc_all to flash both Compulab reference u-boot and Compulab debian image (not balenaOS) works for you as the maintainer suggested in the github ticket?

The command shared by the maintainer would be:

sudo uuu -v -b emmc_all /path/to/compulab-recovery-imx-boot.bin /path/to/compulab-debian-image

also, the correct command for writing the USB stick would be:

unzip -p | sudo dd of=/dev/sdb1 bs=1M status=progress conv=fsync
correct command)
unzip -p | sudo dd of=/dev/sdb bs=1M status=progress conv=fsync

Note that it’s sdb not sdb1.

Please see Provisioning reference image fails on iot-gate-imx8plus · Issue #23 · compulab-yokneam/meta-bsp-imx8mp · GitHub for full details.

1 Like

Hi @Yosef , did these steps work for you to flash the reference Compulab u-boot and Debian?

If yes, did ums work again afterwards?

@acostach it didn’t help I will add the logs soon