jerrm
Posts: 197
Joined: Wed May 02, 2018 7:35 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Thu May 10, 2018 7:57 pm

HawaiianPi wrote:
Thu May 10, 2018 6:36 pm
The bootcode.bin only method solves boot problems with some drives, and works exactly like pure USB boot (everything runs from the USB drive after bootcode.bin is executed). So if you happen to have a problematic drive, bootcode.bin only is easier and arguably "better" than /boot on SD.
I would agree. I only have a couple of units that need bootcode.bin, but I like keeping all the configuration together on one device. Having possibly two /boot images floating around is asking for update issues. It's easy to see someone booting directly off the USB when they had been using the SD as /boot and things ending up out of sync.

Assuming the fix makes it out, my biggest USB boot issue is the CPU utilization issue mentioned here: viewtopic.php?f=28&t=211912#p1307781. Has anyone else seen this?

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Thu May 10, 2018 8:33 pm

jerrm wrote:
Thu May 10, 2018 7:57 pm
I would agree. I only have a couple of units that need bootcode.bin, but I like keeping all the configuration together on one device. Having possibly two /boot images floating around is asking for update issues. It's easy to see someone booting directly off the USB when they had been using the SD as /boot and things ending up out of sync.
The answer to not having /boot on both devices is, well, not having /boot on both devices. You could just have the rootfs on the USB device (one single ext4 partition), but, of course, that's extra work to get everything set up.

Or, you could have a script that synced the contents of /boot to the other device. Since kernel/firmware updates usually require a restart, a shutdown/restart script would keep everything up to date on both devices.

And if you're into wacky solutions, you could try and set up the SD card and USB drive /boot partitions as a mirrored RAID. Image
Not even sure that's possible with Raspbian, because of the way the system boots. Image
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?

jerrm
Posts: 197
Joined: Wed May 02, 2018 7:35 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Thu May 10, 2018 8:52 pm

HawaiianPi wrote:
Thu May 10, 2018 8:33 pm
of course, that's extra work to get everything set up.
Exactly.

Avoiding the possibility of duplicate /boot devices or making sure they are in sync is easy enough, but why bother, unless there is some other need.

Keeping things "clean" with all the OS on one device(albeit two partitions) makes sense to me. Bootcode.bin is a firmware extension from my perspective, not the OS (someone will probably skewer me for saying that).

I don't see duplicate /boot partitions being a risk for myself, but many folks may not be as aware. I'd be willing to bet a super-majority of folks booting off an SD /boot to a USB rootfs have an orphaned /boot partition on the USB (and probably an orphaned / on the SD).

W. H. Heydt
Posts: 10998
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: No bootcode.bin only USB boot on new 3B+ ?

Thu May 10, 2018 11:04 pm

jerrm wrote:
Thu May 10, 2018 8:52 pm
Keeping things "clean" with all the OS on one device(albeit two partitions) makes sense to me. Bootcode.bin is a firmware extension from my perspective, not the OS (someone will probably skewer me for saying that).
I wouldn't phrase it quite that way... Rather, it is desirable--other than for backups--not to replicate the same data on different physical or logical devices. That is taking mirrored, striped, or other coded pattern physical devices as a logical "device". Due to the limitation of device access and transfer speeds, it is also beneficial to spread data across multiple devices to limit latency and transfer speed collectively. I will grant that these issues are not terribly applicable to the Pi as all such data transfer is handled through a single port to the CPU (the sole USB connection), but that may change in the future and we may see Pis that benefit from multiple MSDs and data redundancy. (Not likely any time soon, though.)

While it may not be the optimal arrangement, as an example I have a Linux system (not a Pi) that has 3 HDDs. One has the system, the second has user data, and the third has /tmp and a swap partition (which is almost never used).

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Fri May 11, 2018 2:22 am

The bootcode.bin file is the first file loaded by the GPU at the start of the boot process. It's loaded into the SoC cache memory and executed, and it's bootcode.bin that performs the next stage of the boot process, which includes booting from USB. On older models that file must be loaded from the SD card, while on a Pi3B the system also looks for it on FAT32 partitions of USB drives. Regardless of where it initially loads, the boot process is the same after that.

So a bootcode.bin only SD card still performs a USB boot. Both the rootfs and boot partition reside on the USB drive, and the SD card is not used at all after bootcode.bin is loaded. The main advantage for the Pi3B models is that you can add one additional file named "timeout" on the SD card to increase the boot delay (without needing to set an additional OTP bit). Also, unlike the boot loader that is hard coded into the SoC, bootcode.bin can be updated to improve compatibility and fix bugs.

Most people will not need to use the bootcode.bin only method with a Pi3B, and even fewer with a 3B+ (which has an improved, more compatible boot loader), but it's still nice to have for the few it benefits on the 3B and all older models.
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?

andrum99
Posts: 844
Joined: Fri Jul 20, 2012 2:41 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Sun May 13, 2018 10:33 pm

The bootcode.bin only booting on the Pi 3B+ is fixed as of this commit:

https://github.com/raspberrypi/firmware ... 4ec19b4199

To get the fix, use rpi-update to get the very latest firmware, then copy the new bootcode.bin to your boot SD card.

fanoush
Posts: 484
Joined: Mon Feb 27, 2012 2:37 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Mon May 14, 2018 7:13 am

andrum99 wrote:
Sun May 13, 2018 10:33 pm
To get the fix, use rpi-update to get the very latest firmware
or you could also get it directly from https://github.com/raspberrypi/firmware ... otcode.bin

andrum99
Posts: 844
Joined: Fri Jul 20, 2012 2:41 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Tue May 15, 2018 3:35 pm

fanoush wrote:
Mon May 14, 2018 7:13 am
andrum99 wrote:
Sun May 13, 2018 10:33 pm
To get the fix, use rpi-update to get the very latest firmware
or you could also get it directly from https://github.com/raspberrypi/firmware ... otcode.bin
True, although in the past there have been subtle issues with using firmware that is newer than the kernel so I would not recommend doing it that way, unless you have a specific reason not to keep the firmware and kernel version in sync, or you are using a different kernel to the one provided.

fanoush
Posts: 484
Joined: Mon Feb 27, 2012 2:37 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Tue May 15, 2018 7:11 pm

andrum99 wrote:
Tue May 15, 2018 3:35 pm
I would not recommend doing it that way, unless you have a specific reason not to keep the firmware and kernel version in sync, or you are using a different kernel to the one provided.
Well, the specific reason is to keep stable version of everything except bootcode.bin. While this file is technically part of the firmware, it is the smallest and most independent part by design (1st stage bootloader, or 2nd if you count boot ROM as 1st).

By doing rpi-update you get latest beta firmware and beta kernel which can break far more stuff than just 1st stage bootloader. The part that would be advised to be in sync with kernel is start*.elf which is the main part of the firmware.

EDIT:
I just tried with 3B+ and indeed this bootcode.bin now boots fine over usb when it is alone on the sd card. And firmware reported while linux kernel boots is still older

Code: Select all

[    0.080145] raspberrypi-firmware soc:firmware: Attached to firmware from 2018-04-16 18:16

mjf2708
Posts: 8
Joined: Sat Aug 10, 2013 4:42 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Sun Sep 02, 2018 10:14 pm

I'm getting what I think is a different twist on this.

I'm keen to boot my RPi 3B+ from SSD and use this as my main storage, but before I commit to this, I decided to try booting from a USB flash drive.

I've downloaded Stretch Lite 2018-06-27 to a 16GB Sandisk Cruzer FIT. The RPi boots (it's headless, nothing else connected), and I can SSH into it from my Mac, and run commands from Terminal.

However, I'm getting 4 flashes continuously on the green LED, indicating that start.elf has not been launched? Also, reboot seems to fail - after a few seconds the red power LED goes out.

If, on the other hand, I boot with an SD card containing just bootcode.bin, all seems to be fine. Whilst it's no problem booting this way, I'd like to understand why booting without the SD card isn't working properly.

Any suggestions?

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Mon Sep 03, 2018 1:23 am

add this to config.txt

Code: Select all

dtoverlay=sdtweak,poll_once

"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: 4741
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: No bootcode.bin only USB boot on new 3B+ ?

Mon Sep 03, 2018 4:01 am

LTolledo wrote:
Mon Sep 03, 2018 1:23 am
add this to config.txt

Code: Select all

dtoverlay=sdtweak,poll_once
Or try it with an empty FAT32 micro SD card.

On the other hand, boot but not reboot is a symptom of a not-quite-compatible device. The Raspberry Pi boot-loader is small and simple, due to limited space for the code in the SoC, and as such, it's not boot-compatible with all USB mass storage devices. Some devices will not boot at all, while others will cold boot fine, but fail to reboot.

There is some newer firmware that fixes some USB boot issues, so make sure your system is fully up to date.

Code: Select all

sudo apt update && sudo apt full-upgrade -y

Power supply issues could also be responsible.
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?

mjf2708
Posts: 8
Joined: Sat Aug 10, 2013 4:42 pm

Re: No bootcode.bin only USB boot on new 3B+ ?

Mon Sep 03, 2018 10:36 am

@LTolledo, @HawaiianPi,

Thank you both for your very quick responses and your help. I was still getting problems with sdtweak (no SD / empty SD / SD with bootcode.bin) with reboot and shutdown - red LED going off immediately.
HawaiianPi wrote:
There is some newer firmware that fixes some USB boot issues, so make sure your system is fully up to date.

Code: Select all

sudo apt update && sudo apt full-upgrade -y
This has solved it - now booting / rebooting / shutting down properly with no SD - many thanks! :D

@HawaiianPi: I'm encouraged by this, and this thread: https://www.raspberrypi.org/forums/view ... 3&t=210497, and I have an Eluteng USB SATA cable and SanDisk SSD on order.

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Mon Sep 03, 2018 12:58 pm

Glad you had it running fine.

for my RPi3B+ #3 I housed it in a quattro case like this
https://thepihut.com/products/raspberry ... 6981301265

so I can mount it at the back of my monitor

for storage, either a 2.5" 1TB HDD or 2.5" 250GB SSD

for the cable, I found the Eluteng cable short for the job so I used this adaptor cable
https://www.inateck.com/inateck-ua1003- ... apter.html

and confirmed that it uses the same chipset as Eluteng adaptor, and has indicator LED.

a bit of modifications on the quattro case was needed for good air flow
"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!"

pepeEL
Posts: 80
Joined: Thu Feb 26, 2015 11:23 am

Re: No bootcode.bin only USB boot on new 3B+ ?

Tue Oct 02, 2018 9:38 pm

Hi
Becuase my RPI3 B was destroy and not booting automatically after power on , i buy new version RPI3 B+.
It works ok with microSD with 2018-06-27-raspbian-stretch-lite.
But my RPI3 B+ can not boot from any USB devices... I test 3 SSD mSATA disk by adapter usb, by Suptronics X850 version 1.2 and newer version 1.3, also test on 3 pendrive USB. From any devices not booting. Only boot correct from microSD.

On all devices i installed by Win32Image image 2018-06-27-raspbian-stretch-lite.
On my destroy RPI3 B all this devices worked and before destroy boot correct.

I dont know why newer version RPI3 B+ no boot.
I verifi this manual:
https://www.raspberrypi.org/documentati ... des/msd.md

and i have:

Code: Select all

$ vcgencmd otp_dump | grep 17:
17:3020000a

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Tue Oct 02, 2018 10:26 pm

pepeEL wrote:
Tue Oct 02, 2018 9:38 pm
Hi
Becuase my RPI3 B was destroy and not booting automatically after power on , i buy new version RPI3 B+.
It works ok with microSD with 2018-06-27-raspbian-stretch-lite.
But my RPI3 B+ can not boot from any USB devices...
This post really doesn't fit the topic of the OP, so you probably should have made a new thread.

The boot loader in the Raspberry Pi is not compatible with all USB devices, however the newer 3B+ model is supposed to have improved compatibility, so it's very odd that you are having this problem. I've had no trouble booting my 3B+ from USB devices (SSD/HDD/flash drive).

The older X850 will not boot directly from the SSD, but the newer v1.3 should, if you connect the auxiliary power lead to the correct pins on the GPIO expansion header (in my experience, anyway).

What are you using for a power supply?

Try Etcher to write images to your USB drives (https://etcher.io/).
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?

pepeEL
Posts: 80
Joined: Thu Feb 26, 2015 11:23 am

Re: No bootcode.bin only USB boot on new 3B+ ?

Wed Oct 03, 2018 4:23 am

Please tell me what ssd/HDD/usb you use that works for you...?

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

Re: No bootcode.bin only USB boot on new 3B+ ?

Wed Oct 03, 2018 8:24 am

pepeEL wrote:
Wed Oct 03, 2018 4:23 am
Please tell me what ssd/HDD/usb you use that works for you...?
I have used SSD models from Silicon Power, Samsung, Crucial and MyDigitalSSD brands, as well as a WD Blue 500GB HDD harvested from an old laptop. I've had the best luck with a USB adapter cable from ELUTENG, but I have some others as well that also work for me.

The one I've had the best luck with: ELUTENG USB 3.0 to SATA III Cable (picture) (SSD)

The enclosure I use with my mSATA drive: ELUTENG USB 3.0 mSATA Enclosure (picture) (SSD) (Same SSD in 2.5 adapter with cable above)

Another adapter cable that works well for me: Sabrent EC-SSHD USB 3.0 to SSD / 2.5-Inch SATA Hard Drive adapter.

I like the ELUTENG cable on my Pi due to its shorter length (less cable clutter). The Sabrent has a longer cable and activity LED, if those features are desirable to you, and it's faster when used on the USB 3.0 ports of my gaming laptop (you won't see a difference on the Pi USB 2.0 ports).

I had the older x850 and never was able to get it to boot/reboot reliably without using an SD card to start the boot process. I got a chance to try the newer v1.3 and it seemed to work with the auxiliary power connected, but I decided it was too expensive and specialized and started using the adapters above (which all cost considerably less, and don't limit my case options).

I generally run the latest Raspbian OS, and I use either the the official RPF universal power supply or a RAVPower phone charger to power my Pi 3B/3B+ computers (I highly recommend the official PSU, because some phone chargers can be problematic). When using the phone charger I use Monoprice Premium or Volutz Equilibrium series micro USB cables to deliver the power.
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?

pepeEL
Posts: 80
Joined: Thu Feb 26, 2015 11:23 am

Re: No bootcode.bin only USB boot on new 3B+ ?

Wed Oct 03, 2018 8:30 am

I compare with second RPI3 B+ and on second works all ok. All my devices boot with no problem...
My RPI3 B+ is corrupt and i send it to my seller...

Return to “General discussion”