4

According to official bootmodes documentation, the process of booting Raspberry Pi 3 off USB takes two seconds to wait for mass storage devices (MSD) to enumerate.

That article also says it is also possible to increase this timeout to five seconds by adding certain parameter to config.txt file (program_usb_timeout=1). But where should this file reside? Normally, it is placed next to bootcode.bin, but while we're waiting for MSD to enumerate, we can't read files from it.

Should a SD card with config.txt be inserted in Raspberry Pi before booting off USB in order to increase USB enumeration timeout to 5 seconds?

PS I've got another thought after I've written this question. Is USB enumeration timeout programmed into OTP area of BCM2837 along with enabling USB boot mode?

  • One question before I do this method, can the Pi 3 boot from microSD again after this "program_usb_timeout=1" performed? Or the boot from microSD is permanently disabled, and I can only boot from USB flash/PXE network? – Crescendo Nov 29 '16 at 3:42
  • It isn't necessary to increase USB timeout to 5 seconds. It might just work with 2 seconds timeout. Try yourself. – Alexandr Zarubkin Nov 29 '16 at 4:50
  • It isn't necessary to increase USB timeout to 5 seconds. It might just work with 2 seconds timeout. Try yourself. Also, the boot from microSD is never permanently disabled. If SD card is there, Pi boots off it. – Alexandr Zarubkin Nov 29 '16 at 4:52
3

There are two different things which go by the same name program_usb_timeout: the OTP bit and the corresponding parameter in config.txt. The latter is used to set the former (by booting from SD card), but once the OTP bit is set, there is no need for the SD card anymore. And just in case it's not clear, OTP is a kind of flash memory, so its content is persistent across reboots.

So the full procedure goes like this:

  • prepare a bootable SD card and boot from it
  • run sudo BRANCH=next rpi-update
  • add program_usb_timeout=1 to your config.txt
  • reboot (this is the moment OTP bit will be programmed)
  • power off, remove the SD card and plug USB device
  • power on.

The whole process is described in more details here.

3

Please note the command program_usb_timeout=1 is wrong. The right command is program_usb_boot_timeout=1 The documentation was updated. You can double check if the OTP was programmed correct by vcgencmd otp_dump | grep 66 at row 66, bit 24 should be set: 66 : 01000000

-1

Yes your command

program_usb_timeout=1

Should be placed in the config.txt file on an sdcard as it is the amount of time to wait before connecting to USB devices so it would be impossible to store this information on a device it should be waiting to read from.

  • so SD card should be inserted into Raspberry Pi at all times, even though it now fully supports USB boot? – Alexandr Zarubkin Aug 29 '16 at 4:16
  • Even with USB boot the Pi needs the ad card on boot to run enough of the kernel to load the USB drivers required to continue the boot through the USB interface. Weather you can remove the SD card after boot i am unsure but you probably can. – Mohammad Ali Aug 29 '16 at 5:39
  • 1
    but they say here that no SD card is necessary when booting from USB! – Alexandr Zarubkin Aug 30 '16 at 8:14
  • How do you expect the Pi to understand not to read the USB device if the timeout command is on the USB drive, an sd card will be needed to inform the Pi to delay the reading of USB devices – Mohammad Ali Sep 28 '16 at 11:58
  • Timeout value is programmed into OTP area of the chip. See another answer for details. – Alexandr Zarubkin Sep 28 '16 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.