Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootloader can't boot via USB-HDD after system reboot #151

Closed
wildrun0 opened this issue Jun 6, 2020 · 40 comments
Closed

Bootloader can't boot via USB-HDD after system reboot #151

wildrun0 opened this issue Jun 6, 2020 · 40 comments
Labels
beta Bug only occurs in a beta release

Comments

@wildrun0
Copy link

wildrun0 commented Jun 6, 2020

After rebooting (sudo reboot), im getting stuck in bootloader with this loop:

Failed to open device: 'sdcard' (cmd 371a0010 status 1fff0001)
Failed to open device: 'sdcard' (cmd 371a0010 status 1fff0001)
root HUB port 1 init
root HUB port 3 init
USB MSD timed out after 20 seconds

If at this moment i replug usb-hdd, it will boot correctly, And sometimes it says that: 'SD: card detected' but there isnt no sd card in rpi.

Bootloader version:

pi@raspberrypi:~ $ vcgencmd bootloader_version
Jun  3 2020 13:53:47
version b5de8c32f4f45a12a1fdfe107254df82965f9d56 (release)
timestamp 1591188827

Bootloader configuration:

pi@raspberrypi:~ $ vcgencmd bootloader_config
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
ENABLE_SELF_UPDATE=1
DISABLE_HDMI=0
SD_BOOT_MAX_RETRIES=1
USB_MSD_BOOT_MAX_RETRIES=1
BOOT_ORDER=0xf41

lsusb -vvv output:

pi@raspberrypi:~ $ sudo lsusb -vvv

Bus 002 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         9
  idVendor           0x152d JMicron Technology Corp. / JMicron USA Technology Corp.
  idProduct          0x0578 JMS567 SATA 6Gb/s bridge
  bcdDevice           32.02
  iManufacturer           1 JMicron
  iProduct                2 JMS579
  iSerial                 3 6640391D
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0079
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              896mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        Command pipe (0x01)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        MaxStreams             32
        Status pipe (0x02)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-in pipe (0x03)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               7
        MaxStreams             32
        Data-out pipe (0x04)
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0016
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000f0e
      BESL Link Power Management (LPM) Supported
    BESL value     3840 us
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat          32 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x000c
  (Bus Powered)
  U1 Enabled
  U2 Enabled

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            4.19
  iManufacturer           3 Linux 4.19.118-v7l+ xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:01:00.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0
Hub Descriptor:
  bLength              12
  bDescriptorType      42
  nNbrPorts             4
  wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  bHubDecLat          0.0 micro seconds
  wHubDelay             0 nano seconds
  DeviceRemovable    0x00
 Hub Port Status:
   Port 1: 0000.02a0 5Gbps power Rx.Detect
   Port 2: 0000.0203 5Gbps power U0 enable connect
   Port 3: 0000.02a0 5Gbps power Rx.Detect
   Port 4: 0000.02a0 5Gbps power Rx.Detect
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000f
  bNumDeviceCaps          1
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x0008
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   3
      Lowest fully-functional device speed is SuperSpeed (5Gbps)
    bU1DevExitLat           4 micro seconds
    bU2DevExitLat         231 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x2109 VIA Labs, Inc.
  idProduct          0x3431 Hub
  bcdDevice            4.21
  iManufacturer           0
  iProduct                1 USB2.0 Hub
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x002a
  bNumDeviceCaps          3
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      HIRD Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat           4 micro seconds
    bU2DevExitLat         231 micro seconds
  Container ID Device Capability:
    bLength                20
    bDescriptorType        16
    bDevCapabilityType      4
    bReserved               0
    ContainerID             {30eef35c-07d5-2549-b001-802d79434c30}
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            4.19
  iManufacturer           3 Linux 4.19.118-v7l+ xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:01:00.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0507 highspeed power suspend enable connect
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

@timg236 timg236 added the awaiting information No progress can be made until the requested information is provided label Jun 6, 2020
@timg236
Copy link
Collaborator

timg236 commented Jun 6, 2020

The bug report doesn't provide any of the information in the template so ignoring for now

@wildrun0
Copy link
Author

wildrun0 commented Jun 6, 2020

The bug report doesn't provide any of the information in the template so ignoring for now

My fault, sorry. This information is what you needed?

@timg236
Copy link
Collaborator

timg236 commented Jun 7, 2020

It doesn't say which hard drive you are using. A few other people are successfully using JPMicron SATA adapters. It might be worth trying a powered hub as well.
If you are able to collect XHCI_DEBUG logs that would be very useful, although, we'll also continue to collect details of USB devices where failure occurs so that we can try to get hold of a representative and do some interop testing.

@wildrun0
Copy link
Author

wildrun0 commented Jun 7, 2020

It doesn't say which hard drive you are using. A few other people are successfully using JPMicron SATA adapters. It might be worth trying a powered hub as well.
If you are able to collect XHCI_DEBUG logs that would be very useful, although, we'll also continue to collect details of USB devices where failure occurs so that we can try to get hold of a representative and do some interop testing.

I'm using Seagate ST9320325AS connected via sata to usb3 adapter(there's 2 cables, one for data and second for additional power supply)
And what do exactly i need to get from XHCI_DEBUG? 0x3 logs?

@timg236
Copy link
Collaborator

timg236 commented Jun 8, 2020

XHCI_DEBUG is documented here,
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md

The UART or NETCONSOLE trace would determine whether the USB port shows the connected state or not after a reboot. Ideally, it would be set to 0xff for full traces, which is very verbose so a one off trace log.

Before, that, if you could try the following bootloader which forces a reset of port power at reboot that would be useful. It's just a guess so really I just want to know if there is any observable change in behaviour.

rpi-eeprom-recovery-c1325cd20.zip

@wildrun0
Copy link
Author

wildrun0 commented Jun 8, 2020

rpi-eeprom-recovery-c1325cd20.zip

I've tried this bootloader and it works fine. Thanks! Now Pi successfully boots after rebooting.
Also i've tried to connect second power usb(as i said above, i use sata to usb3 adapter w/ 2 cables) to power supply (just for test) and it couldn't boot (same issue)

@lurch
Copy link
Contributor

lurch commented Jun 8, 2020

I guess there's no way for the external power-supply to know that it's supposed to reset port power?

EDIT: Sorry if I caused confusion @timg236 , my comment was directed at @wildrun0 rather than yourself!

@timg236
Copy link
Collaborator

timg236 commented Jun 8, 2020

The external power supply is not under the control of the USB host controller (it's invisible) and I don't think external power supplies know about the USB state.
The disadvantage of toggling the power at boot is that it makes other devices (e.g. external raid controllers) much slower to boot which are fine after a reboot.
@P33M Does this seem familiar?

@P33M
Copy link

P33M commented Jun 8, 2020

I am assuming that the "two cables" statement means one with the data pairs, and one with extra power wires. If both the cables are plugged into the Pi, then the device gets power cycled across a reboot. It could be getting upset because the power cycle isn't long enough - is there a configurable wait parameter for pausing prior to attempting MSD boot?

@timg236
Copy link
Collaborator

timg236 commented Jun 8, 2020

In the attached patch it's a non-configurable 100ms in the off state. The default bootloader does not toggle port power. What's not clear is why a device works from a cold reboot but needs the port power to be toggled after a soft reset.

@P33M
Copy link

P33M commented Jun 8, 2020

Does the assertion of PCIe fundamental reset (as would happen over a reboot) not disable port power on the VL805?

@timg236
Copy link
Collaborator

timg236 commented Jun 8, 2020

No, PCIe fundamental reset does NOT appear to disable port power. The reboot case is more confusing now because if there is no SD-card or the board has the SD PWR switch (8GB) then the PMIC won't be reset which I think does reset the port power.

PCIE_0_RGR1_SW_INIT_1 |= PCIE_0_RGR1_SW_INIT_1_PCIE_BRIDGE_SW_INIT_SET;
PCIE_0_RGR1_SW_INIT_1 |= PCIE_0_RGR1_SW_INIT_1_PCIE_SW_PERST_SET;

@raspberrypi raspberrypi deleted a comment from geerlingguy Jun 8, 2020
@geerlingguy
Copy link

I just made a comment that I thought may be relevant to this issue, but it was just deleted... I was encountering the same issue and had some extra screenshots/recordings to help with those who may also encounter the issue. Should I repost that information, or did I do something wrong?

@timg236
Copy link
Collaborator

timg236 commented Jun 8, 2020

@geerlingguy The comment adds a slightly annoying animation indicating a power issue but gave no information about the hardware being used. Create a new bug report and fill out the required information.
Interoperability reports are of limited use if the hardware description is just SSD

@geerlingguy
Copy link

That sounds fine; I was just trying to assist others who may encounter the same issue as in the OP and that I was having—basically stating in simple terms that the fix (without further modifying the firmware) is to power down the Pi completely (e.g. unplug it), then power it back on (a 'hard' reboot).

It took me a few cycles and searching for this issue before I connected the dots that this bug (regardless of what kind of USB volume is used) is only related to soft reboots.

@timg236
Copy link
Collaborator

timg236 commented Jun 9, 2020

Understood but the assertion that this happens "regardless of what kind of USB volume is used" is not correct. We have successfully tested with multiple adapters and SSDs and so have people on the forums. There may well be a class of devices which require an extended power off on reset but we'll never know what that is if bug reports aren't specific.

@timg236 timg236 added beta Bug only occurs in a beta release and removed awaiting information No progress can be made until the requested information is provided labels Jun 9, 2020
@timg236
Copy link
Collaborator

timg236 commented Jun 9, 2020

ST9320325AS

If you have details of the SATA adapter (e.g. an Amazon link) that would be useful.

@lurch
Copy link
Contributor

lurch commented Jun 9, 2020

Just as a point of comparison, I wonder if @ghollingworth encountered similar issues with the USB MSD boot on 3B / 3B+ ?

@wildrun0
Copy link
Author

wildrun0 commented Jun 9, 2020

ST9320325AS

If you have details of the SATA adapter (e.g. an Amazon link) that would be useful.

I've searched this adapter in internet and found nothing useful. I buy this in a local store so i guess this adapter from china (aliexpress i think). All the useful information i found:
Connectors: USB Am 4pin,USB 3.0 Am 9pin, SATA+powerSATA

@timg236
Copy link
Collaborator

timg236 commented Jun 9, 2020

No problem, I think we are going to have to get hold of a selection of adapters because logging or even protocol analysers don't really help if the USB port doesn't detect the device.

@wildrun0
Copy link
Author

wildrun0 commented Jun 9, 2020

I can send a photo of an adapter if it helps

@wildrun0
Copy link
Author

wildrun0 commented Jun 9, 2020

So here it is
AsKbQE6_0_k

@geerlingguy
Copy link

FYI the adapter I'm currently testing with is the Inateck 2.5" SATA HDD External Enclosure, FEU3NS-1 on Amazon. With that enclosure, the Pi 4 does not soft reboot successfully.

I also have an Inland SATA adapter and one from Startech.com, so I'll try with those and see if they allow a soft reboot or if they fail in the same way.

@timg236
Copy link
Collaborator

timg236 commented Jun 10, 2020

FYI the adapter I'm currently testing with is the Inateck 2.5" SATA HDD External Enclosure, FEU3NS-1 on Amazon. With that enclosure, the Pi 4 does not soft reboot successfully.

I also have an Inland SATA adapter and one from Startech.com, so I'll try with those and see if they allow a soft reboot or if they fail in the same way.

Thanks, I can now add that to the purchase order :)

Please could you try the soft reboot with rpi-eeprom-recovery-c1325cd20.zip which is attached to this bug, flash using the Raspberry Pi Imager. If you happen to have a powered USB hub then it would be useful to know if that changes behaviour with the experimental bootloader.

@geerlingguy
Copy link

@timg236 - I followed the directions in the the rpi-eeprom-recovery-c1325cd20.zip README.txt, got the green HDMI display, and re-tested, and what do you know, soft reboots work now!

I didn't test with a powered USB hub yet though. Would I need to re-re-flash it back to something else again?

@geerlingguy
Copy link

geerlingguy commented Jun 10, 2020

So some results with the other adapters:

Adapter Hard Boot Soft Reboot
Inateck enclosure (bottom)
Startech SATA to USB 3.0 cable (top right)
Inland USB 3.0 SATA adapter (top left)

IMG_1465

This is all using the c1325cd20 recovery zip that you had uploaded to this issue. I forgot to test with the other two prior to flashing it with that.

@timg236
Copy link
Collaborator

timg236 commented Jun 10, 2020

Thanks @geerlingguy and @wildrun0 those are really useful data points, I think the default behaviour needs to change to power off ports for a short while at boot (which is what this patch does). Although, I might add an option to disable that, even if there are too many options already.
I think some USB hubs might interfere with this fix but I think it increases the set of supported devices without breaking others.
I'll post an update this week with a candidate for the next beta, there's a couple of other fixes which I want to include as well if possible.

timg236 added a commit to timg236/rpi-eeprom that referenced this issue Jun 12, 2020
* Reset Ethernet MAC + PHY if final boot mode is not network boot
  See: Kernel warning and network failure when attempting to use
       the network after bootloader times out. raspberrypi#144
* Improve handling of multiple bootable USB devices and remove USB_MSD_BOOT_MAX_RETRIES
* Resolve: No DHCPACK with DHCP relay agent raspberrypi#58
* Toggle USB root hub port power for 200ms on the first USB MSD boot attempt
  See: Bootloader can't boot via USB-HDD after system reboot raspberrypi#151
* Update bootloader handover to support uart_2ndstage - requires a newer
  start.elf firmware which will be via rpi-update.
* Assert PCIe fundamental reset if the final bootmode was not USB-MSD
  because the OS might not do this before starting XHCI.
@timg236
Copy link
Collaborator

timg236 commented Jun 16, 2020

Resolved in pieeprom-2020-06-15

@timg236 timg236 closed this as completed Jun 16, 2020
@lurch
Copy link
Contributor

lurch commented Jun 16, 2020

Just out of curiosity @timg236 , did you manage to work out why some devices need a power-cycle after a warm-reboot? (but are fine from a cold-boot)

@matonb
Copy link

matonb commented Aug 25, 2020

Just an FYI

I recently bought 4 RPi 4's, which I immediately updated to the latest firmware:

Jul 31 2020 14:43:39
version f8d1dc69144b10b4bd78b4b6d08658ac3005726d (release)
timestamp 1596203019

Two of the pi's boot from SSD no problem at all, but two failed with failed to find sd card etc. etc.

After a bit of trial and error I eventually updated/downdraded the bootloader to the 16th July 2020 version pieeprom-2020-07-16.bin on the two troublesome Pi's, which then succesfully booted from SSD.

I then updated the bootloader to the 31st July version and they still booted.

It would appear that the 16th July version does 'something' which the 31st July version does not...

@spaskalev
Copy link

I am also experiencing a soft-reboot stuck with the latest stable eepron on a 8gb rpi 4, an non-powered orico usb-c to sata adapter and a sandisk sata ssd, powered only through the adapter. On a soft reboot the bootloader screen will report that an SD card is found while there is none, iterate through the usb devices and appears stuck afterwards. A hard reset will make it start.

Jun 8 2020 10:30:11 version c1325cd20901c069d2af151508b910b35c7a2810 (release) BOOT_ORDER=0xf41

@Laser128128
Copy link

Hi All

I also have the same issue, but even an extended power down (with the cable removed) is not solving my issue. I think my issue is that I used a NVME SSD and used a NVME to USB3 adaptor instead of SATA to USB3? The drive does show up as removable storage in raspbian and I can copy the SDCard contents to it but it doesn't get recognised during boot.

If someone with more knownledge could just confirm that my issue is due to using NVME rather than SATA then that will be great. Thanks

@matonb
Copy link

matonb commented Sep 14, 2020

@Laser128128 Did you try upgrading to pieeprom-2020-07-16.bin first ?

@Laser128128
Copy link

Hi @matonb

Yes I did. I managed to get it working in the end by following this guide:
https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/

It is lightning fast now and I have more storage space to work with. I still can't get it to work completely without the SD card. From my limited understanding it still needs the SD card to tell the pi to boot from the SSD, I can live with this for now and will probably look at moving away from the SD card completely at a later stage.

Thanks

@matonb
Copy link

matonb commented Sep 14, 2020

Hi @Laser128128,

Maybe your combination of NVME drive and Adpator is missing the sweet spot at the mo.
I'm using Inateck USB 3.0 External Hard Drive Case FE2004C, with either SANDisk or Crucial SSD drives.

When I got USB Boot to work I no longer need an SD card installed at all.
I used Jeff Geerlings guide as a starting point: https://www.jeffgeerling.com/blog/2020/im-booting-my-raspberry-pi-4-usb-ssd

Regards,
Brett

@geerlingguy
Copy link

geerlingguy commented Sep 14, 2020

@Laser128128 - That blog post was written before the Pi Foundation released new firmware updates to support direct booting from USB drives.

You need to follow the updated process to make sure your Pi's firmware has this feature enabled. See my more recent blog post: https://www.jeffgeerling.com/blog/2020/im-booting-my-raspberry-pi-4-usb-ssd

Specifically, you'll need to:

sudo apt update
sudo apt full-upgrade
sudo nano /etc/default/rpi-eeprom-update

Change the "critical" to "stable" and save that file.

Then update the firmware:

sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-07-16.bin

(Note the firmware version—the pieeprom file date—might be newer since I last updated that post. Check that folder for the latest version with ls -lah /lib/firmware/raspberrypi/bootloader/stable to see what the version is currently.)

@matonb
Copy link

matonb commented Sep 14, 2020

@geerlingguy I had problems getting USB Boot to work if I didn't update to pieeprom-2020-07-16.bin first, after that updating to the latest stable firmware didn't cause a problem.

That happend on two fo the 8GB pi's I bought and one 2GB so it's a bit hit and miss...

@HarvsG
Copy link

HarvsG commented Nov 11, 2020

I'm having the same problem with an Ubuntu desktop USB flash drive on RPI 400. 20200903 eeprom

I think this must a drive or Ubuntu issue because it does not happen with raspbian and another drive.

@mpwsh
Copy link

mpwsh commented Nov 27, 2020

I can confirm this is happening with an SSD Intel 454s (Using 2020-07-16 eeprom and also latest update)
I have a cluster with 4 Raspberry pi 4 and only the one with the intel SSD is failing to boot

USB Adapter: All raspis are using ADATA ED600 adapter.
SSD Drives: 3 ADATA SU630 (Working OK)
1 Intel 454s Not booting (Showing Failed to open device: 'sdcard')

Swapping drives confirms that the problem is the intel drive

@raspberrypi raspberrypi locked as resolved and limited conversation to collaborators Nov 27, 2020
@timg236
Copy link
Collaborator

timg236 commented Nov 27, 2020

The original issue was resolved. If other configurations are failing then it will be a different issue albeit with similar symptoms. For hardware interop please create a separate issue if the USB devices are not the same as the original report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Bug only occurs in a beta release
Projects
None yet
Development

No branches or pull requests

10 participants