Update EEPROM for Compute Module 4
What is Compute Module 4
The Raspberry Pi Compute Module 4 (CM4) leverages the computing power of the popular Raspberry Pi 4 Model B, with dramatic performance changes compared to its predecessor: faster CPU cores, better multimedia, more interface capabilities. And for the first time, this release offers multiple choices of RAM density and wireless connectivity options.
In terms of external dimensions, this version adopts a completely new mechanical standard. The overall footprint of the module on its carrier board is reduced, resulting in a smaller and more compact form factor suitable for integration into products.
The power of Raspberry Pi 4 in a compact form factor for deeply embedded applications. Raspberry Pi Compute Module 4 incorporates a quad-core ARM Cortex-A72 processor, dual video output, and a wide selection of other interfaces. Available in 32 variants, with a range of RAM and eMMC Flash options, and with or without wireless connectivity. -- Raspbarry Pi CM4{target=_blank}
Seeed Studio Compute Module 4 Products
reTerminal | Edgebox-RPI-100 | EdgeLogix-RPI-1000 | reRouter | Dual Gigabit Ethernet NICs Carrier Board |
---|---|---|---|---|
How to update CM4 EEPROM
Prerequisite
Hardware Required:
- Linux Based Host Computer(could be one of following):
- Raspberry Pi 4B with Raspberry Pi OS installed
- PC with latest Ubuntu OS installed
- USB Type-C cable
Applicable Seeed Studio Hardware:
reTerminal | reRouter | Dual Gigabit Ethernet NICs Carrier Board |
---|---|---|
This process requires to put the CM4 eMMC stroage into 'USB mass storage' mode, which currently on applicable with reRouter and reTerminal. If you have Edgebox-RPI-200 or EdgeLogix-RPI-1000 you will need to have a CM4 development board that could put CM4 eMMC storage into USB storage mode, For example Dual Gigabit Ethernet NICs Carrier Board{target=_blank}
Put CM4 eMMC Storage into USB mass storage Mode
For reTerminal
- Step 1: Open the case and remove the heatsink of reTerminal to get access the boot selection switch, Please follow the steps from the reTerminal Getting Started Wiki Page until you have flipped the boot mode switch.
For reRouter
- Step 1: Open the case of reRouter by remove the bottom 4 screws and the bottom cover as shown below:
- Step 2: Slide down the reRouter board from the case and take it out
- Step 3: Locate the 3-pin interface and short the GND and BOOT pins.
Dual Gigabit Ethernet NICs Carrier Board is the same PCB as the reRouter which just need to do the Step 3 to select the boot mode.
Software Setup and Update EEPROM Firmware
On your PC or Raspberry Pi 4B (Flash Tool)
To update the EEPROM for raspberry pi only support with Linux based operating system, The following steps only tested on PC with Ubuntu 22.04 and Raspberry Pi 4B (Flash Tool) with Raspberry Pi OS (64-bit)
- Step 1: Install required system software package, please open
Terminal
app and type follow command:
sudo apt-get update
sudo apt install git pkg-config make gcc libusb-1.0-0-dev
- Step 2: Clone the
usbboot
tool repository
cd ~/
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
- Step 3: Build the
usbboot
tool
make
- Step 4: Update the EEPROM
The usbboot
github repo should have the latest EEPROM bootloader firmware updated, so following step should get you updated to the latest EEPROM bootloader firmware
cd recovery
./update-pieeprom.sh
You should see the similar message as shown below:
Optional: If you want use the specific release of the bootloader firmware you could visit the rpi-eeprom{target=_blank} repo firmware folder to select and download firmware bin file to replace the pieeprom.original.bin
file, For example:
This optinal step will replace the pieeprom.original.bin
file with the latest stable
build pieeprom-2023-01-11.bin
at the time of writing this wiki.
cd ~/usbboot/recovery
rm -f pieeprom.original.bin
curl -L -o pieeprom.original.bin https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware/stable/pieeprom-2023-01-11.bin
./update-pieeprom.sh
You should see the similar message as shown below:
Step 5: Connect the USB Type-C to the CM4 Device(
reTerminal
\reRouter
\Dual Gigabit Ethernet NICs Carrier Board
) and theHost PC/Rasbperry Pi 4B(Flash Tool)
Device, which the CM4 Device should be put into the USB massive storage mode.Step 6: To apply and update the EEPROM firmware
cd ~/usbboot
./rpiboot -d recovery
You should see the similar message as shown below:
At this point your CM4 Device
should have the new boot order setup and updated EEPROM firmware.
Change Boot Order and Update EEPROM
You should have followed the above setup step until Step 3
- Step 1: Edit the
boot.conf
cd ~/usbboot/recovery
nano boot.conf
the file should look like as following:
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
# Try SD first (1), followed by, USB PCIe, NVMe PCIe, USB SoC XHCI then network
BOOT_ORDER=0xf25641
# Set to 0 to prevent bootloader updates from USB/Network boot
# For remote units EEPROM hardware write protection should be used.
ENABLE_SELF_UPDATE=1
where the BOOT_ORDER=0xf25641
line is the Boot order settings, where the current boot order setting is SD CARD/eMMC > USB-MSD > NVME > BCM-USB-MSD > NETWORK > RESTART
. If you want to change to boot order to NVME > USB-MSD > BCM-USB-MSD > SD CARD/eMMC > NETWORK > RESTART
the boot order setting should be BOOT_ORDER=0xf21564
.
Therefore the new boot order setting the boot.conf
should looks like following:
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
# Try SD first (1), followed by, USB PCIe, NVMe PCIe, USB SoC XHCI then network
BOOT_ORDER=0xf21564
# Set to 0 to prevent bootloader updates from USB/Network boot
# For remote units EEPROM hardware write protection should be used.
ENABLE_SELF_UPDATE=1
Save and exit the nano
editor.
The following is the table that defines the property of different boot modes setting for BOOT_ORDER for reference.
Value | Mode | Description |
---|---|---|
0x0 | SD CARD DETECT | Try SD then wait for card-detect to indicate that the card has changed - deprecated now that 0xf (RESTART) is available. |
0x1 | SD CARD/eMMC | SD card (or eMMC on Compute Module 4). |
0x2 | NETWORK | Network boot |
0x3 | RPIBOOT | RPIBOOT |
0x4 | USB-MSD | USB mass storage boot |
0x5 | BCM-USB-MSD | USB 2.0 boot from USB Type C socket (CM4: USB type A socket on CM4IO board). |
0x6 | NVME | CM4 only: boot from an NVMe SSD connected to the PCIe interface. |
0x7 | HTTP | HTTP boot over ethernet. |
0xe | STOP | Stop and display error pattern. A power cycle is required to exit this state. |
0xf | RESTART | Restart from the first boot-mode in the BOOT_ORDER field i.e. loop |
Reference: BOOT_ORDER Property Table
- Step 2: Get the latest firmware
wget -O pieeprom.original.bin https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware/stable/pieeprom-2023-01-11.bin
- Step 3: Update the EEPROM firmware with the new
boot.conf
./update-pieeprom.sh
Step 4: Connect the USB Type-C to the CM4 Device(
reTerminal
\reRouter
\Dual Gigabit Ethernet NICs Carrier Board
) and theHost PC/Rasbperry Pi 4B(Flash Tool)
Device, which the CM4 Device should be put into the USB massive storage mode.Step 5: Apply the firmware to the device
cd ~/usbboot
sudo ./rpiboot -d recovery
You should see the similar message as shown below:
At this point your CM4 Device
should have the new boot order setup and updated EEPROM firmware.
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.