Page 1 of 1

Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 3:20 pm
by ertank
Hello,

I am using Raspberry Pi 3 Model B+

I have attached SupTronics X850 V3.0 extension board with a 128GB mSATA SSD. I am happy with the performance so far. One thing I would like to do is directly boot from USB without waiting for a primary and secondary sd fail delays as explained in here: https://www.raspberrypi.org/documentati ... ootflow.md

Referring to this page (about 2/3 position): https://sensorgnome.org/The_Raspberry_P ... ensorgnome
My connection of SupTronics board is on USB port number 4 which in boot sequence checked as last port and takes long enough until Pi starts actual boot sequence that my screen goes power saving mode or close itself completely, etc.

Same problem exists for power re-cycle and reboot.

I did a lot of search in the internet. I failed to find anything to remove these delays for usb only boot, or switch boot priority and put USB to be checked first.

Any help is appreciated.

Thanks & regards,
Ertan

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 3:29 pm
by Andyroo
You cannot - these are built into the firmware on the Pi (GPU I think) and cannot be changed :cry:

You do not normally have to reboot Pi computers that often as even updates go one cleanly normally. Folk around here have had the running for years with no reboot.

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 3:42 pm
by rpdom
Putting a blank SD card in the Pi will mean that the card is checked and ignored very quickly. Any size card will do, even a fake one should be sufficient.

There is a way to override some of the boot sequences, but it means permanently setting a bit in the OTP and pulling some of the GPIOs high or low at boot time.

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 4:30 pm
by ertank
Andyroo wrote:
Fri Mar 29, 2019 3:29 pm
You cannot - these are built into the firmware on the Pi (GPU I think) and cannot be changed :cry:

You do not normally have to reboot Pi computers that often as even updates go one cleanly normally. Folk around here have had the running for years with no reboot.
This is a development device. I choose to use SSD in order to improve compiler timings. I do not use my Pi for some kind of a server. Unfortunately, I need all kind of power re-cycle, reboot, etc.

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 5:08 pm
by Andyroo
rpdom wrote:
Fri Mar 29, 2019 3:42 pm
Putting a blank SD card in the Pi will mean that the card is checked and ignored very quickly. Any size card will do, even a fake one should be sufficient.

There is a way to override some of the boot sequences, but it means permanently setting a bit in the OTP and pulling some of the GPIOs high or low at boot time.
I thought of those https://www.raspberrypi.org/documentati ... ootflow.md but with this being an SSD I would have thought it was SDA so should boot first in the list AFTER the SD card?

As for a blank SD Card - would never have thought that as I had too many years of floppy disks with no OS on them :roll: :oops: :roll:

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 5:12 pm
by lewmur
All it takes is having a tiny vfat boot partition on the SD card with a config.txt file pointing to the SSD's boot partition. Then, instead of waiting for a no response from the built in boot order, it reads the config.txt file from the very first device it tries and immediately goes to the partition designated in that file. On earlier Pi models, that was the ONLY way you could boot from USB devices.

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 6:31 pm
by ertank
lewmur wrote:
Fri Mar 29, 2019 5:12 pm
All it takes is having a tiny vfat boot partition on the SD card with a config.txt file pointing to the SSD's boot partition. Then, instead of waiting for a no response from the built in boot order, it reads the config.txt file from the very first device it tries and immediately goes to the partition designated in that file. On earlier Pi models, that was the ONLY way you could boot from USB devices.
Assuming my SSD device is /dev/sda1 what should I write in that config.txt file in sdcard?

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 6:42 pm
by rpdom
lewmur wrote:
Fri Mar 29, 2019 5:12 pm
All it takes is having a tiny vfat boot partition on the SD card with a config.txt file pointing to the SSD's boot partition. Then, instead of waiting for a no response from the built in boot order, it reads the config.txt file from the very first device it tries and immediately goes to the partition designated in that file. On earlier Pi models, that was the ONLY way you could boot from USB devices.
No, for those Pi models you need bootcode.bin, not config.txt.

For the models that boot natively from USB you just need an empty partition.

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 7:39 pm
by HawaiianPi
ertank wrote:
Fri Mar 29, 2019 6:31 pm
Assuming my SSD device is /dev/sda1 what should I write in that config.txt file in sdcard?
That post from lewmur was completely wrong. The old-school way was to have the /boot partition on the SD card, and cmdline.txt pointed to the USB drive for the root filesystem. That method is now obsolete, and a FAT32 formatted SD card with only the bootcode.bin file is what you use to boot any Pi that does NOT support USB boot directly.

For the Raspberry Pi 3B+ (or the 3B/2Bv1.2 with the USB boot OTP bit set), you can boot directly from USB with no SD card. However, having an empty FAT32 SD card in the system will reduce boot time by roughly 5 seconds (reduced SD card detection timeout). You can change the boot device priority by setting additional OTP bits, after which your Pi will not be bootable at all unless you tell it where to boot using GPIO (by pulling certain pins up/down you can tell it to boot from USB first). I don't know how much time this saves, because I have never tried it myself.

Without setting additional OTP bits, USB boot will always be slower than SD card boot. Have you considered booting your system from a fast A1 rated micro SD card and using the SSD for your coding?

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Fri Mar 29, 2019 8:23 pm
by LTolledo
A. Remove delays for USB boot only:
1. Use blank fake microSD card in microSD slot
2. Dont edit the configuration files (config.txt, cmdline.txt)

B. switch USB to be the first checked on boot:
1. this is firmware coded
2. unless you can set optional OTP bits (me also have not tried, me no need for it)

5 seconds delay for booting up the RPI via USB is not a big concern for me
why?
my USB HDD native boot RPi3B ALWAYS win the boot up to desktop (fresh and reboot) race between my I7 16GB W10 SSD pc by a very wide margin :D

Re: Remove delays for USB only boot or switch USB to be the first cheked in boot sequence

Posted: Sat Mar 30, 2019 1:20 am
by HawaiianPi
LTolledo wrote:
Fri Mar 29, 2019 8:23 pm
5 seconds delay for booting up the RPI via USB is not a big concern for me
why?
my USB HDD native boot RPi3B ALWAYS win the boot up to desktop (fresh and reboot) race between my I7 16GB W10 SSD pc by a very wide margin :D
Sounds like your Win10 machine needs a faster SSD.

My Win10 gaming laptop boots faster than my Pi3B+ does from an A1 uSD card (<10s).
Image

And believe it or not, this isn't even the fastest consumer SSD available!
(It was when I bought it, but that was over a year ago...)