Compute Module 4 changed the flashing routine in a few small but important ways, and knowing those differences ahead of time saves you a frustrating session. The module still boots over USB with rpiboot, and its eMMC still appears as a USB drive for imaging, but the boot enable signal moved to a jumper called nRPIBOOT, and the recovery and mass storage options gained CM4 specific directories. This guide covers the CM4 workflow from start to finish: setting the jumper, running rpiboot, flashing eMMC, recovering a bootloader EEPROM, and switching back to normal booting. If you have flashed older modules before, most of this will feel familiar, with the CM4 details clearly marked.
Set the nRPIBOOT jumper
On CM4, you enable USB boot by fitting the nRPIBOOT jumper, which is connected to GPIO 40. Fit that jumper on your carrier board before you connect USB or apply power, just as you set the J4 jumper on older IO boards. The name is different, but the idea is identical: the jumper tells the boot ROM to listen over USB instead of booting from eMMC. Check your carrier board documentation for the exact jumper location, since carrier boards place it in different spots, but the signal name nRPIBOOT is what you are looking for.
Fit the jumper firmly and confirm it sits on the correct pins. A loose jumper that slips during handling can drop the module out of USB boot mode halfway through a session, and the symptom looks like a cable failure. Once the jumper is set, connect the host to the board’s USB port and power the board. rpiboot on the host should then discover the module. If it does not, recheck the jumper before you swap cables or reinstall software, since the jumper is the CM4 specific step most likely to be missed by users coming from older modules.
Flash CM4 eMMC with mass storage mode
For a standard CM4 flash, run rpiboot with no special directory, or use the mass storage gadget for CM4. On Linux, that is sudo ./rpiboot from the usbboot directory. On Windows, use the rpiboot-CM4-CM5 – Mass Storage Gadget shortcut, or plain rpiboot from Command Prompt, which defaults to mass-storage-gadget64. Either route loads the bootloader files and start.elf, then puts the module into mass storage gadget mode. The eMMC appears on the host as a USB drive, ready for imaging.
Verify the drive before you write, just as with older modules. Confirm its size matches the CM4 eMMC capacity, and use the listing tools on your host to spot the new device. Then write your OS image with your chosen tool: dd on Linux, with the usual warning to verify the device path first, or Raspberry Pi Imager on either platform. Let the write finish fully, eject or sync the drive safely, and then remove the nRPIBOOT jumper and power cycle the board. On the fresh boot, the CM4 will start from its own eMMC, and your new OS will come up normally.
Recover a CM4 bootloader EEPROM
CM4 stores its bootloader in an EEPROM, a small rewritable chip separate from eMMC, and that bootloader can occasionally need recovery. rpiboot handles that job with a dedicated directory: run rpiboot -d recovery. That command loads recovery boot files instead of the mass storage gadget, and those files rewrite the bootloader EEPROM to a known good state. You use this mode when a CM4 will not boot at all, when a bootloader update went wrong, or when you are preparing a batch of modules and want a clean bootloader baseline across all of them.
The recovery run looks different from a flash, so do not expect a USB drive to appear. Watch the rpiboot output for progress, let it finish completely, and do not power off the board mid recovery. Cutting power during an EEPROM write can leave the bootloader in a worse state than before, so give the process its full time even if the screen looks quiet. When recovery completes, remove the nRPIBOOT jumper, power cycle, and test a normal boot. If the module boots, the EEPROM is healthy again, and you can proceed to flash eMMC if the OS also needs attention.
Secure boot recovery on CM4
CM4 also supports a secure boot recovery mode, reached with rpiboot -d secure-boot-recovery. Secure boot is a feature that checks boot files against a signature before running them, and recovery in this area deals with signed files and keys. The signing option in rpiboot, -s, signs boot files using bootsig.bin, and a secure boot recovery run depends on that signature file being present and matching. If bootsig.bin is missing or mismatched, signing fails, and secure boot recovery will not proceed. That failure is a protection, not a bug, since running unsigned files on a secured module would defeat the point of secure boot.
Most everyday CM4 users will never need secure boot recovery, and that is fine. Treat it as a specialist mode for modules that were set up with secure boot in the first place. If you do need it, gather the correct signed files and bootsig.bin before you start, confirm they belong to the same secure boot setup, and then run the recovery command. Keep a record of which modules use secure boot and which do not, since mixing signed and unsigned workflows across a fleet is a reliable way to create confusing failures. For standard modules without secure boot, stick to the mass storage and plain recovery modes.
Use the mass storage gadget directory directly
You can also invoke the mass storage gadget explicitly with rpiboot -d mass-storage-gadget64, which is the directory used for CM4 and CM5 mass storage. That explicit form is useful when you want to be certain about which boot files load, or when you are scripting a flashing station and want every step spelled out. It produces the same result as the default on Windows and the plain run on Linux for CM4 work: the eMMC appears as a USB drive. The explicit directory simply removes ambiguity, and in a scripted setup, removing ambiguity is worth the extra characters.
When you use the explicit directory, the rest of the workflow stays the same. Verify the drive, write the image, eject safely, remove the nRPIBOOT jumper, and power cycle. The gadget directory does not change how imaging works, and it does not change the safety rule about verifying the dd target. It only pins down the boot file set, which helps when you are documenting a process for a team or repeating it across many modules. Write the full command in your runbook so every operator uses the same form.
It also helps to label your CM4 boards and carrier boards once you start working with more than one. A small sticker noting the module type, the eMMC size, and the OS you last flashed saves you from opening a case or guessing later. When you pick up a board for a new job, that label tells you its history at a glance, and you can decide in seconds if it needs a fresh flash, a recovery run, or nothing at all.
Conclusion
rpiboot for Compute Module 4 follows the familiar loop with CM4 specific details. Fit the nRPIBOOT jumper on GPIO 40, connect USB, power the board, and run rpiboot to expose the eMMC as a USB drive for imaging. Use rpiboot -d recovery when the bootloader EEPROM needs rewriting, and rpiboot -d secure-boot-recovery only for modules set up with secure boot, with a matching bootsig.bin. Finish every job by removing the jumper and power cycling so the module boots from eMMC. Learn those CM4 details once, and the module becomes as routine to flash and recover as any older Compute Module you have worked with.
Read next:
