Skip to content

Instantly share code, notes, and snippets.

@AndreaGhizzoni
Last active October 2, 2023 19:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreaGhizzoni/c36516069143a76496f7db9a8d5d9650 to your computer and use it in GitHub Desktop.
Save AndreaGhizzoni/c36516069143a76496f7db9a8d5d9650 to your computer and use it in GitHub Desktop.
raspberrypi-enable-usb-boot.md

Program USB Boot Mode

Before a Raspberry Pi 3 will boot from a mass storage device, it needs to be booted from an SD card with a config option to enable USB boot mode. This will set a bit in the OTP (One Time Programmable) memory in the Raspberry Pi SoC that will enable booting from a USB mass storage device. Once this bit has been set, the SD card is no longer required. Note that any change you make to the OTP is permanent and cannot be undone.

First update the system (just in case..)

$ sudo apt-get update && sudo apt-get upgrade

Then enable USB boot mode with this code:

$ echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

This adds program_usb_boot_mode=1 to the end of /boot/config.txt. Then reboot. Now check that the OTP has been programmed with:

$ vcgencmd otp_dump | grep 17:
17:3020000a

Ensure the output 0x3020000a is shown. If it is not, then the OTP bit has not been successfully programmed.

If you wish, you can remove the program_usb_boot_mode line from /boot/config.txt, so that if you put the SD card in another Raspberry Pi, it won't program USB boot mode.

IMPORTANT: Make sure there is no blank line at the end of /boot/config.txt.

Prepare the USB mass storage device

Write on usb stick your favorite raspberrypi linux image then plug it into your RaspberryPi 3.

Boot your Raspberry Pi 3 from the USB mass storage device

Attach the USB mass storage device to your Raspberry Pi 3 and power it up. The booting process will take between five and ten seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment