Raspberry Pi CM5 IoT In C - Setting Up the CM5
Written by Harry Fairhead   
Monday, 14 April 2025
Article Index
Raspberry Pi CM5 IoT In C - Setting Up the CM5
Installing Pi OS
Boot EPROM
Booting From NVMe

Boot EPROM

The CM5 uses a separate EPROM to hold the boot code. Previous versions of the Pi stored the boot code in the file bootcode.bin in the boot partition of the device being used to boot the system. The CM5 doesn’t automatically update the boot loader and it is up to you to ensure that you are working with the latest version. First update Linux and dependencies on the CM5:

sudo apt update
sudo apt upgrade

and to sure you have the latest EEPROM

sudo rpi-eeprom-update -a

You have to reboot to make any changes and you can check what version you have using:

sudo rpi-eeprom-update


You can disable any changes to the boot loader by placing a jumper on the correct pins of J2:

The boot loader can be configured using the rpi-eeprom-config command wh
ich, with no parameters will display the current configuration:

To change the configuration you can use the command:

 sudo -E rpi-eeprom-config --edit

This loads the current configuration into the nano editor and saves it using:

sudo rpi-eeprom-update

Probably the most used boot configuration parameter is BOOT_ORDER which you can use to set the CM5 to boot from NVMe. USB etc.

The documentation lists the possible values and refers to other parts of the documentation for more information:

Value

Mode

Description

0x0

SD CARD DETECT

Tries SD then waits for card-detect to indicate that the card has changed. Deprecated now that 0xf (RESTART) is available.

0x1

SD CARD

SD card (or eMMC on Compute Module 4/5).

0x2

NETWORK

Network boot - Refer to Network boot server tutorial.

0x3

RPIBOOT

RPIBOOT - See usbboot.

0x4

USB-MSD

USB mass storage boot - See USB mass storage boot.

0x6

NVME

Boots from an NVMe SSD connected to the PCIe interface. See NVMe boot for more details.

0x7

HTTP

HTTP boot over ethernet. See HTTP boot for more details.

0xe

STOP

Stop and display error pattern. A power cycle is required to exit this state.

0xf

RESTART

Restarts from the first boot-mode in the BOOT_ORDER field i.e. loop.

To specify a boot order you put the hex codes together with the right-most code tried first and so on. For example, to boot from NVMe and then try eMMC if that fails you would use:

BOOT_ORDER=0xf16

Notice that the initial f means that the boot sequence will be cycled through until the number of attempts exceeds MAX_RESTARTS.

There are lots of additional boot configuration parameters and you can look them up at:

https://www.raspberrypi.com/documentation/computers/
 raspberry-pi.html#raspberry-pi-bootloader-configuration

If you are concerned about security then make sure that you only boot from the internal eMMC.



Last Updated ( Monday, 14 April 2025 )