rpiboot Commands and Options Explained

rpiboot Commands and Options Explained

rpiboot has a short option list, and learning it properly turns the tool from a single trick into a flexible part of your Compute Module workflow. Most users only ever need the default run and one or two directory flags, but the loop, verbose, signing, port restriction, and timing options each solve a real problem when the moment arrives. This guide explains every documented option in plain language, shows the commands you will actually type, and gives you example combinations for flashing, recovery, and debugging. Keep it beside you during your first few sessions, and the flags will soon feel like second nature.

The default run and the directory option

Run rpiboot with no arguments and it boots the attached device into mass storage device mode, exposing the Compute Module’s eMMC as a USB drive on the host. That default is the command you will use most, and on Linux it looks like sudo ./rpiboot. It is worth memorizing exactly, including the sudo and the ./ prefix, since both are required in the standard Linux build layout. If you remember only one rpiboot command, make it this one, because it covers the everyday flashing job on its own.

The -d option changes which boot files rpiboot loads. The form is rpiboot -d followed by a directory name, and that directory holds the bootloader files and start.elf for a particular job. Use -d recovery for CM4 bootloader EEPROM recovery, -d recovery5 for CM5, -d secure-boot-recovery for CM4 secure boot, -d secure-boot-recovery5 for CM5, -d rpi-imager-embedded for the embedded Raspberry Pi Imager, and -d mass-storage-gadget64 for CM4 and CM5 mass storage. Each directory name is a job in itself, so choosing the directory is choosing the task. When you add -o alongside -d, rpiboot also uses files from the “overlay” subdirectory inside that directory, which lets a setup layer extra files onto the base boot set.

Loop, verbose, and help

The -l flag tells rpiboot to loop forever instead of exiting after the transfer. That is useful when you flash modules one after another on a bench, since you do not need to relaunch the tool for each board. Plug in a module, let rpiboot serve it, unplug it, plug in the next one, and the same running instance picks it up. For a single module, you do not need -l, and the tool exiting after transfer is a clean signal that the job is done. For a batch, -l saves you repeated launches and keeps your rhythm going.

The -v flag turns on verbose output, which prints detailed information about what rpiboot is doing as it talks to the device. Use it when a module is not behaving, when a recovery run looks stalled, or when you want to confirm which files loaded. Verbose output is longer and noisier than the default, so you would not leave it on for routine flashes, but during debugging it is the first flag to add. The -h flag prints help, listing the options with short descriptions. Run it any time you need a reminder, on either platform, with no hardware attached, and it will refresh the full list in seconds.

Signing boot files

The -s flag signs boot files using bootsig.bin. Signing matters for secure boot setups, where the Pi checks a signature before it runs boot files, and bootsig.bin carries the signature data that check expects. You would combine -s with a directory run when you are working on a secured module, for example during secure boot recovery. The key detail is that bootsig.bin must be present and must match the secure boot setup for that module. If it is missing, or if it belongs to a different setup, signing fails, and the run will not proceed as you hoped.

Treat signing failures as a file problem first, not a tool problem. Confirm bootsig.bin sits where rpiboot expects it, confirm it matches the module’s secure boot configuration, and confirm you have not mixed files from two different secured modules. For modules without secure boot, you do not need -s at all, and adding it will only complicate a routine flash. Keep signing in its own lane, used deliberately for secured hardware, and your everyday flashing stays simple.

Port restrictions and timing

The -0 through -6 flags restrict rpiboot to Compute Modules on USB ports 0 through 6. Each number picks one port, so -0 limits the tool to port 0, -3 limits it to port 3, and so on. That restriction is handy on a bench with several modules attached, or when another USB device on the host could be mistaken for a target. By pinning rpiboot to a single port, you remove ambiguity about which module it will serve. If you only ever attach one module at a time, you will not need these flags, but on a multi module bench they are a simple safety and clarity win.

The -m flag sets the delay in microseconds between device checks, and its default is 500. In practice, that means rpiboot checks for a device every 500 microseconds while it waits. You would adjust -m only if you have a timing related reason, such as a host that struggles with rapid polling or a setup where a longer gap between checks behaves better. For most users, the default is correct, and changing it without a specific symptom will not improve a normal session. Note it in your reference, leave it at 500 unless a real problem points at timing, and focus your debugging on jumpers, cables, and ports first.

Putting flags together

Flags combine naturally, and a few combinations cover most real sessions. A verbose recovery run on Linux looks like sudo ./rpiboot -d recovery -v, which loads the CM4 recovery files and shows detailed output while it works. A looped mass storage bench run looks like sudo ./rpiboot -l, which keeps serving modules as you swap them. An embedded Imager session looks like sudo ./rpiboot -d rpi-imager-embedded, which boots the embedded Imager instead of the mass storage gadget. Each combination reads left to right as a sentence: what to load, how loudly to report, and how long to keep going.

On Windows, the same flags work from Command Prompt, with plain rpiboot defaulting to mass-storage-gadget64. A Windows directory run is rpiboot -d recovery, and help is rpiboot -h, matching the Linux forms apart from sudo and the ./ prefix. That cross platform consistency is a quiet strength of rpiboot: once you learn the flags on one system, they transfer to the other, and your notes stay valid when you switch hosts. Write down your three most used combinations and keep them with your flashing gear, so you never have to reconstruct a command from memory mid session.

A final tip will keep your command line sessions calm. When a flag combination works well for you, save it in a plain text note with a one line description of the job it does. Over time you will build a small personal reference that matches your bench, your modules, and your hosts. That reference beats searching online mid session, and it means a colleague can repeat your exact steps without asking you to reconstruct them from memory.

Conclusion

The rpiboot option list is short, but each flag earns its place. The default run gives you mass storage mode for everyday flashing. The -d flag picks the job, from recovery and secure boot recovery to embedded Imager and mass storage gadget, with -o adding overlay files. The -l flag loops for batch work, -v adds detail for debugging, -h reminds you of the list, and -s signs files for secure boot with bootsig.bin. Port flags -0 through -6 pin the tool to one USB port, and -m sets the device check delay from its 500 microsecond default. Learn the default first, add directory flags for special jobs, and reach for verbose and loop flags when debugging or batching, and rpiboot will cover every Compute Module task you throw at it.

Read next:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top