RaspberryPi CM4 not booting with PCIe device (VL805)

Hi,

I’m currently evaluating balena as a solution for fleet management of our industrial IoT devices. I was able to run our software in a container on the CM4 + IO board. Moving the same CM4 to our custom board caused the CM4 to not boot (activity led is on constantly but no signal on HDMI). Our design is really close to the official IO board in terms of the I/O and peripheral layout except that it includes a VL805 PCIe to 4x USB3 chip onboard.
Plugging a PCIe to USB card with the VL805 chip into the PCIe slot of the official IO board also causes the CM4 to not boot.
Does someone have an idea why connecting the VL805, that is also used on RaspberryPi 4B and that works fine with RaspberryPiOS, causes balenaOS to fail to boot? I’ve tried to get some output from the serial interface, but was unsuccessful to read anything except for some new-line characters.

Thanks in advance.

1 Like

Hello @NiBr welcome to the balena community!

It looks like your board is not completely compatible with the CM4 device type balenaOS. I will ping the balena devices team to see how we can help you more.

In the meantime, please let us know what are you testing. Thanks

Hi @mpous, thanks for the reply.
even if we let our custom board aside, the CM4 flashed with the image from the dashboard for my “RaspberryPi CM4 IO Board”-fleet will not boot even on the standard IO board, as soon as I plug in the PCIe VL805 card. The same card works fine with standard RaspberryPiOS and the same chipset is also used on the RaspberryPi 4B.
What kind of additional information can I provide? I was trying to provision my test device with balena and setting up our custom application to be run on my test fleet (currently consisting of a single device).

What Raspberry Pi OS version are you using @NiBr ?

We are currently using RaspberryPiOS lite ARM64 from 2022-04-04, though 32bit was working fine as well.

Hello @NiBr,

Have you tried with NVMe before eMMC in BOOT_ORDER? The short story is that there are some complexities with PCIe initialization, and putting NVMe before your eMMC forces PCIe initialization. This might resolve your issue. Your device will still boot from eMMC.

A few related threads:

If you haven’t set BOOT_ORDER before on a CM4, there are instructions online e.g.

The above links are the best source of instructions. But in case it helps, here are the steps that I use on my Mac. I haven’t done this in a while, so the steps may be somewhat out of date:

  1. Build rpiboot on Mac to update the bootloader in eeprom on the CM4
  • git clone --depth=1 https://github.com/raspberrypi/usbboot
  • cd usbboot
  • Check BOOT_ORDER in recovery/boot.conf, edit as needed
    BOOT_UART=1
    # First try NVMe(6), then SD/eMMC(1), USB PCIe(4), USB SoC XHC(5), net(2)
    BOOT_ORDER=0xf25416
  • cd recovery
  • ./update-pieeprom.sh
  • cd ..
  • make
  1. Power off Pi

  2. Fit jumper on CM4 IO Board J2 to disable eMMC boot

  3. Connect micro-USB cable to CM4 IO Board

  4. Update eeprom
    *Run rpiboot on the host, wait for a connection:
    ./rpiboot

  • Power the CM4 - your Mac should see the CM4
  • Flash the new bootloader information to the Pi (you may need to power off and power on your Pi):
    sudo ./rpiboot -d recovery

You should get output such as:

RPIBOOT: build-date Feb 26 2022 version 20220208~181027 042cd145
Loading: recovery/bootcode4.bin
Waiting for BCM2835/6/7/2711…
Loading: recovery/bootcode4.bin
Sending bootcode.bin
Successful read 4 bytes 
Waiting for BCM2835/6/7/2711…
Loading: recovery/bootcode4.bin
Second stage boot server
Loading: recovery/config.txt
File read: config.txt
Loading: recovery/pieeprom.bin
Loading: recovery/pieeprom.bin
Loading: recovery/pieeprom.sig
File read: pieeprom.sig
Loading: recovery/pieeprom.bin
File read: pieeprom.bin
Unknown message
  1. Remove the jumper

  2. Power off Pi

If you do try this, please let us know how it goes.

Hi @rosswesleyporter,

thanks for the detailed reply. I’ve got the CM4 to boot using BOOT_ORDER=0xf25416.

Best regards!

1 Like

Hello @NiBr,

Thanks for letting us know that it worked for you.