The firmware upgrade on Raspberry Pi CM5 at the moment (December 2024) is complicated by the fact that the available downloadable versions of RPIBOOT do not work with the BCM2712 processor.
You have to build it yourself, but luckily, it’s done in a few commands on the console. To flash the CM5 using these instructions, you will need a Linux PC, Windows with WSL (Windows Subsystem for Linux) installed, or MAC.
First, remove the current version with the command
sudo apt remove rpiboot
Next, clone the repository and build the application (Linux or WSL):
sudo apt install git libusb-1.0-0-dev pkg-config build-essential
git clone --recurse-submodules --shallow-submodules --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
make
On a Mac OS the command will be a little different, but the essence doesn’t change:
git clone --recurse-submodules --shallow-submodules --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
brew install libusb
brew install pkg-config
make
If the build is unable to find the header file libusb.h
then most likely the PKG_CONFIG_PATH
is not set properly. This should be set via export PKG_CONFIG_PATH="$(brew --prefix libusb)/lib/pkgconfig"
.
If the build fails on an ARM-based Mac with a linker error such as ld: warning: ignoring file '/usr/local/Cellar/libusb/1.0.27/lib/libusb-1.0.0.dylib': found architecture 'x86_64', required architecture 'arm64'
then you may need to build and install libusb-1.0
yourself:
curl -OL https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.tar.bz2
tar -xf libusb-1.0.27.tar.bz2
cd libusb-1.0.27
./configure
make
make check
sudo make INSTALL_PREFIX=/usr/local install
cd ..
Now you can connect the CM5 in bootloader mode. On the Compute Blade, turn the switch to USB-C mode, hold down the nRPIBOOT button (next to the USB-C port), and plug in the USB-C cable. Just in case, the other end of the cable in your computer from which the firmware is being flashed. When the LEDs light up the button can be released.
Only If you are using WSL (Windows Subsystem for Linux), you will need to forward the USB device:
I recommend using the usbipd tool (download here https://github.com/dorssel/usbipd-win/releases).
usbipd.exe list
Run the command with administrator privileges (just make sure that the correct BUSID is selected). In my case 1-8
usbipd.exe wsl attach --busid 1-8 --auto-attach
To update the firmware use the command:
sudo ./rpiboot -d ./recovery5
If HDMI is connected and everything goes well, the screen will turn green.
Run the command on the host PC to access the internal memory of the CM5:
sudo ./rpiboot -d ./mass-storage-gadget64
Moreover, if NVMe is connected, you will have access to it as well:
I’m a systems engineer in JetBrains company. Uptime Lab founder. I’m glad to see you on my website! I hope you find my content useful. Please subscribe to my Instagram and Twitter. I post the newest updates there.