cranphin
Posts: 2
Joined: Fri Nov 10, 2017 8:10 pm

No USB boot with ADATA S102 (Raspberry Pi 2)

Fri Nov 10, 2017 9:04 pm

Hi!

Following https://www.raspberrypi.org/documentati ... bootmodes/, I thought I would be able to boot USB with only an SD card containing bootcode.bin.

This does in fact work! With an old smelly 4gb USB stick..

But with my fancy Blue! ADATA S102 USB3.0 32GB stick, no such luck. All I get is the green led blinking 4 times repeatedly.

Using a full SD card install, I can find and mount the new USB stick, no special steps required.

Also, copying the full content of the USB stick 'boot partition' to the SD card also boots the new USB stick correctly, which will be my workaround :)

Is there any hope for this to ever work? Is there anything I can provide to help debug this? Is there any trick to make this work?
I tried putting a empty 'timeout' file in the root of the SD card, that didn't seem to help.

Cheers!

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

Re: No USB boot with ADATA S102 (Raspberry Pi 2)

Sat Nov 11, 2017 4:17 am

Do you have more than one USB storage device plugged in? Because bootcode.bin just tries to boot the first storage device it finds, and if that isn't a bootable device it ends the boot process with an error.

You could also try adding boot_delay=1 to config.txt to give the drive a bit more time to get ready.
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?

RonR
Posts: 289
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: No USB boot with ADATA S102 (Raspberry Pi 2)

Sat Nov 11, 2017 6:33 am

cranphin wrote:
Fri Nov 10, 2017 9:04 pm
Is there any hope for this to ever work? Is there anything I can provide to help debug this? Is there any trick to make this work?
Even if it had worked, there would be shortcomings lurking in its future:

viewtopic.php?f=29&t=196778

(Excellent choice on the ADATA S102 flash drive -- that's what I use here.)

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: No USB boot with ADATA S102 (Raspberry Pi 2)

Sat Nov 11, 2017 7:16 am

cranphin wrote:
Fri Nov 10, 2017 9:04 pm
Following https://www.raspberrypi.org/documentati ... bootmodes/, I thought I would be able to boot USB with only an SD card containing bootcode.bin.

This does in fact work! With an old smelly 4gb USB stick..
It means in general you're doing everything right.
HawaiianPi wrote:
Sat Nov 11, 2017 4:17 am
You could also try adding boot_delay=1 to config.txt to give the drive a bit more time to get ready.
May be, it will not help in this case. If there is only bootcode.bin on the SD-card, then config.txt needs to be readed from USB. But how should this happen, if the USB doesn't appear? Or doesn't appear fast enough ...
cranphin wrote:
Fri Nov 10, 2017 9:04 pm
But with my fancy Blue! ADATA S102 USB3.0 32GB stick, no such luck. All I get is the green led blinking 4 times repeatedly.
It's possible, the approach with the single bootcode.bin on the SD-card isn't compatible with USB3, or the USB3 needs to long - not in general, but for the initial sequence? These things are often designed, to work fast on the mostly used operating system, such special cases are not a point of interest for the manufacturer nor for the vendor. Also it is a different thing, to have only bootcode.bin on the card on one side or to have a complete bunch of bootfiles (kernel, start.elf etc.) there on the other.

EDIT: Can we assume, the TO uses an older RPi2-model V1.1 and not the V1.2? This can make also a difference?

Best Regards, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

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

Re: No USB boot with ADATA S102 (Raspberry Pi 2)

Sat Nov 11, 2017 7:56 am

FM81 wrote:
Sat Nov 11, 2017 7:16 am
...May be, it will not help in this case. If there is only bootcode.bin on the SD-card, then config.txt needs to be readed from USB. But how should this happen, if the USB doesn't appear? Or doesn't appear fast enough ....
Oops, sorry that's the wrong delay. There is a way with bootcode.bin, a specially named file on the SD card, but my aging grey matter is failing me at the moment. I'll see if I can find it.

EDIT:
Adding an empty file called TIMEOUT on the SD card with bootcode.bin increases the wait time for a device to get ready.
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?

cranphin
Posts: 2
Joined: Fri Nov 10, 2017 8:10 pm

Re: No USB boot with ADATA S102 (Raspberry Pi 2)

Sat Nov 11, 2017 12:17 pm

HawaiianPi wrote:
Sat Nov 11, 2017 4:17 am
Do you have more than one USB storage device plugged in?
I've done several tests with just the ADATA USB stick in, so that's not the issue, but thank's for the suggestion, it's good to keep in mind :)
HawaiianPi wrote:
Sat Nov 11, 2017 7:56 am
Adding an empty file called TIMEOUT on the SD card with bootcode.bin increases the wait time for a device to get ready.
If you read my original post carefully, I did actually try that, sadly it makes no difference :)
FM81 wrote:
Sat Nov 11, 2017 7:16 am
It means in general you're doing everything right.

It's possible, the approach with the single bootcode.bin on the SD-card isn't compatible with USB3, or the USB3 needs to long - not in general, but for the initial sequence? These things are often designed, to work fast on the mostly used operating system, such special cases are not a point of interest for the manufacturer nor for the vendor. Also it is a different thing, to have only bootcode.bin on the card on one side or to have a complete bunch of bootfiles (kernel, start.elf etc.) there on the other.

EDIT: Can we assume, the TO uses an older RPi2-model V1.1 and not the V1.2? This can make also a difference?
Yeah, I've been thinking along the same lines. The approach is compatible with -some- USB3 flash drivers, since they generally are USB2 compatible, and people have had succes with them. I'm guessing it's not a timeout issue, but more a subtle difference in the protocol that's handled correctly by the linux USB driver, but is not handled by the bootcode.bin. Which is fair :)

As to your question, I seem to have a chinese V1.1

Code: Select all

cat /proc/cpuinfo:
model name      : ARMv7 Processor rev 5 (v7l)
Hardware        : BCM2835
Revision        : [b]a21041[/b]
Serial          : 00000000674d7d89

cat /proc/device-tree/model
Raspberry Pi 2 Model B Rev 1.1

Oh, and here's the dmesg info for both the old working USB stick, and the new USB stick, in that order.

Code: Select all

[    3.546507] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.687254] usb 1-1.2: New USB device found, idVendor=0781, idProduct=5151
[    3.704151] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.721497] usb 1-1.2: Product: Cruzer Micro
[    3.735630] usb 1-1.2: Manufacturer: SanDisk
[    3.749602] usb 1-1.2: SerialNumber: 4528800F10C22A61
[    3.765450] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[    3.782251] scsi host0: usb-storage 1-1.2:1.0
[    4.807554] scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer           7.01 PQ: 0 ANSI: 0 CCS
[    4.827994] sd 0:0:0:0: [sda] 7862911 512-byte logical blocks: (4.03 GB/3.75 GiB)
[    4.846072] sd 0:0:0:0: [sda] Write Protect is off
[    4.860946] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 08
[    4.861303] sd 0:0:0:0: [sda] No Caching mode page found
[    4.876650] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.899219]  sda: sda1 sda2
[    4.914971] sd 0:0:0:0: [sda] Attached SCSI removable disk

Code: Select all

[  522.497193] usb 1-1.4: new high-speed USB device number 6 using dwc_otg
[  523.458665] usb 1-1.4: New USB device found, idVendor=125f, idProduct=312b
[  523.458682] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  523.458693] usb 1-1.4: Product: ADATA USB Flash Drive
[  523.458703] usb 1-1.4: Manufacturer: ADATA
[  523.458713] usb 1-1.4: SerialNumber: 2790704340200007
[  523.460118] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[  523.460888] scsi host1: usb-storage 1-1.4:1.0
[  524.488478] scsi 1:0:0:0: Direct-Access     ADATA    USB Flash Drive  1.00 PQ: 0 ANSI: 6
[  524.490587] sd 1:0:0:0: [sdb] 60620800 512-byte logical blocks: (31.0 GB/28.9 GiB)
[  524.491372] sd 1:0:0:0: [sdb] Write Protect is off
[  524.491397] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[  524.492016] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[  524.492832] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  524.497421]  sdb: sdb1 sdb2
[  524.501963] sd 1:0:0:0: [sdb] Attached SCSI removable disk
I might create an issue on https://github.com/raspberrypi/firmware, not sure it's worth trying though :)

Oh, and just for info. The reason for wanting this, is that a modern USB stick is a lot quicker to back up than a SD card, I tend to break things and like to have many backups. For a 32GB sd card that's over a hour, the SD stick has more then halved that :)
Tbh. the workaround is fine, I just write the raspbian image to the usb stick, then copy the contents of the fat32/boot partition to the sd card.
Only downsides:
- I need to disable auto expanding in cmdline.txt before first boot, because it changes the drive id's, but doesn't update the SD card, so no boot after it's reboot.
- So I then need to manually expand on the USB stick, which is finicky
- After any update I need to check if the boot partition on the USB stick was modified, and if so copy it over to the SD card.
I guess I could just have only the ext4 partition on the USB stick, but then I'd have to back up the SD card and the USB stick, which I don't like :)

Return to “Troubleshooting”