Compute Module EEPROM bootloader

Since Compute Module 4, Compute Modules use an EEPROM bootloader. This bootloader lives in a small segment of on-board storage instead of the boot partition. As a result, it requires different procedures to update. Before using a Compute Module with an EEPROM bootloader in production, always follow these best practices:

  • Select a specific bootloader release. Verify that every Compute Module you use has that release. The version in the usbboot repo is always a recent stable release.

  • Configure the boot device by setting the BOOT_ORDER .

  • Enable hardware write-protection on the bootloader EEPROM to ensure that the bootloader can’t be modified on inaccessible products (such as remote or embedded devices).

Flash Compute Module bootloader EEPROM

To flash the bootloader EEPROM:

  1. Set up the hardware as you would when flashing the eMMC, but ensure EEPROM_nWP is not pulled low.

  2. Run the following command to write recovery/pieeprom.bin to the bootloader EEPROM:

    $ ./rpiboot -d recovery
  3. When complete, EEPROM_nWP can be pulled low again.

Flash storage devices other than SD cards

The Linux-based mass-storage-gadget64 supports flashing of NVMe, eMMC, and USB block devices. mass-storage-gadget64 writes devices faster than the firmware-based rpiboot mechanism, and also provides a UART console to the device for debugging.

usbboot also includes a number of extensions that enable you to provision secure-boot or launch custom Linux initramfs images.

Update the Compute Module bootloader

On Compute Modules with an EEPROM bootloader, ROM never runs recovery.bin from SD/eMMC. These Compute Modules disable the rpi-eeprom-update service by default, because eMMC is not removable and an invalid recovery.bin file could prevent the system from booting.

You can override this behaviour with self-update mode. In self-update mode, you can update the bootloader from USB MSD or network boot.

self-update mode does not update the bootloader atomically. If a power failure occurs during an EEPROM update, you could corrupt the EEPROM.

Modify the bootloader configuration

To modify the Compute Module EEPROM bootloader configuration:

  1. Navigate to the usbboot/recovery directory.

  2. If you require a specific bootloader release, replace pieeprom.original.bin with the equivalent from your bootloader release.

  3. Edit the default boot.conf bootloader configuration file to define a BOOT_ORDER:

    • For network boot, use BOOT_ORDER=0xf2.

    • For SD/eMMC boot, use BOOT_ORDER=0xf1.

    • For USB boot failing over to eMMC, use BOOT_ORDER=0xf15.

    • For NVMe boot, use BOOT_ORDER=0xf6.

  4. Run ./update-pieeprom.sh to generate a new EEPROM image pieeprom.bin image file.

  5. If you require EEPROM write-protection, add eeprom_write_protect=1 to /boot/firmware/config.txt.

    • When enabled in software, you can lock hardware write-protection by pulling the EEPROM_nWP pin low.

  6. Run the following command to write the updated pieeprom.bin image to EEPROM:

    $ ../rpiboot -d .