ertank
Posts: 40
Joined: Sat Feb 18, 2017 4:44 pm

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

Fri Mar 29, 2019 3:20 pm

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

Andyroo
Posts: 4124
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

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

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.
Need Pi spray - these things are breeding in my house...

User avatar
rpdom
Posts: 14973
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

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.

ertank
Posts: 40
Joined: Sat Feb 18, 2017 4:44 pm

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

Fri Mar 29, 2019 4:30 pm

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.

Andyroo
Posts: 4124
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

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

Fri Mar 29, 2019 5:08 pm

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:
Need Pi spray - these things are breeding in my house...

lewmur
Posts: 368
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

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

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.

ertank
Posts: 40
Joined: Sat Feb 18, 2017 4:44 pm

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

Fri Mar 29, 2019 6:31 pm

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?

User avatar
rpdom
Posts: 14973
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Fri Mar 29, 2019 6:42 pm

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.

User avatar
HawaiianPi
Posts: 4523
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

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

Fri Mar 29, 2019 7:39 pm

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?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

LTolledo
Posts: 1742
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

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

Fri Mar 29, 2019 8:23 pm

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
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
HawaiianPi
Posts: 4523
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

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

Sat Mar 30, 2019 1:20 am

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...)
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “General discussion”