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

Crucial BX500 SSD using a StarTech USB 3.0(USB3S2SAT3CB) cable USB-Boot fails after doing a soft reboot #261

Closed
RefineryX opened this issue Dec 7, 2020 · 15 comments

Comments

@RefineryX
Copy link

RefineryX commented Dec 7, 2020

Describe the bug
I am booting from a Crucial BX500 SSD using a StarTech USB 3.0(USB3S2SAT3CB) cable. When doing a soft reboot via sudo reboot the system does not boot back up (but it does work fine if doing a hard reboot).

@tmm1 was having similar issues in #241. I installed the 2020-10-28 BETA and seemed to be working fine but has returned on the 2020-11-24 version.

Unfortunately, I do not have a HDMI cable to attach a monitor to get the output of the screen. If you think that will help (if no one else has reported such issues), I can purchase one to help with the issue.

Expected behaviour
Always boot via Crucial BX500 SSD when doing a soft reboot via sudo reboot.

Bootloader version and configuration

Nov 24 2020 15:08:04
version 6fdd3d2be0127f72508c4c2ed48df7b260637ed9 (release)
timestamp 1606230484
update-time 1607196873
capabilities 0x0000001f
[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
BOOT_ORDER=0xf41
USB_MSD_EXCLUDE_VID_PID=105825a3
USB_MSD_PWR_OFF_TIME=0

For USB_MSD_PWR_OFF_TIME: settings, see comments in post 3

USB boot:

I am booting from: Crucial BX500 SSD using a StarTech USB 3.0 (USB3S2SAT3CB) cable.

In addition, I have a WD Elements connected that stores media only and not used for booting.

'lsusb -vvv' Output
Bus 002 Device 003: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x1058 Western Digital Technologies, Inc.
  idProduct          0x25a3 Elements Desktop (WDBWLG)
  bcdDevice           10.19
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x002c
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                8mA
    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

Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. Name: ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x174c ASMedia Technology Inc.
  idProduct          0x55aa Name: ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
  bcdDevice            1.00
  iManufacturer           2 
  iProduct                3 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0079
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    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     0x81  EP 1 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     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             32
        Data-out pipe (0x04)
      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
        Status pipe (0x02)
      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               0
        Command pipe (0x01)

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
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            5.04
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  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

Bus 001 Device 007: ID 1cf1:0030 Dresden Elektronik 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.01
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1cf1 Dresden Elektronik
  idProduct          0x0030 
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0043
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0 
      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              16
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      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     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Couldn't open device, some information will be missing
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 
  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

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
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            5.04
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  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
@lurch
Copy link
Contributor

lurch commented Dec 7, 2020

Have you tried experimenting with the USB_MSD_PWR_OFF_TIME setting? https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md

@RefineryX
Copy link
Author

RefineryX commented Dec 7, 2020

Thanks for the link @lurch. I've just read through and two settings stand out:

It seems with USB_MSD_EXCLUDE_VID_PID= I can exclude my WD Elements drive from being considered for booting. I have included this in my config (including the VID and PID.

I also try a few settings using USB_MSD_PWR_OFF_TIME=. I tried 2000, 3000, 4000 and 5000. I also tried USB_MSD_PWR_OFF_TIME=0. Unfortunately these do not work.

Given these settings, I have updated my config in post 1.

@timg236 timg236 changed the title USB-Boot fails after doing a soft reboot Crucial BX500 SSD using a StarTech USB 3.0(USB3S2SAT3CB) cable USB-Boot fails after doing a soft reboot Dec 11, 2020
@RefineryX
Copy link
Author

Just did a fresh install on my Pi. Here's a couple of things I discovered (still with the same boot loader config).

1. With both devices plugged in (Crucial BX500 and WD Elements HDD), it boots fine every-time At this stage the WD Elements is not mounted.
2. When mounting the WD Elements in /etc/fstab, after a reboot this appears to be the point of failure. It no longer warm reboots and fails every time. A hard restart is required.

Contents in /etc/fstab:

proc            /proc           proc    defaults          0       0
PARTUUID=a47ba398-01  /boot           vfat    defaults          0       2
PARTUUID=a47ba398-02  /               ext4    defaults,noatime  0       1
UUID=bcec36c4-0184-4183-b8be-912f8f5c9c43 /mnt/elements ext4 defaults,nofail, 0 0

PARTUUID=a47ba398 is the BX500 and the the other (ending in 9c43) is the one I mounted.

@lurch
Copy link
Contributor

lurch commented Dec 12, 2020

Could you try 1a. - boot with both devices plugged in but with WD Elements not mounted, mount it manually using the mount command (i.e. not via fstab) and then see if it warm-reboots successfully?

This sounds like such a strange edge-case that I suspect Tim will need XHCI_DEBUG logs in order to diagnose this further.

@pelwell
Copy link
Collaborator

pelwell commented Dec 12, 2020

I would recommend getting an HDMI cable or hooking up a serial interface in order to find out at what point the boot fails. Without this information we are just guessing.

Also think about the power supply - one difference with the automatic mounting is the higher peak power consumption during boot when, thanks to systemd, everything is happening at once.

@RefineryX
Copy link
Author

RefineryX commented Dec 12, 2020

Thank you both (@lurch + @pelwell - appreciate your time!

1a. - boot with both devices plugged in but with WD Elements not mounted

I have just commented out the line in fstab and stopped the HDD from mounting. Rebooting again and strangely, the rPi does not boot.

I would recommend getting an HDMI cable or hooking up a serial interface in order to find out at what point the boot fails. Without this information we are just guessing.

Thanks Phil, you're right. I have went ahead and order a cable which should arrive tomorrow. Hoping that there is a obvious error waiting for me when I login.

I think my power supply is fine and has plenty of power. It is the only one connected into an Anker PowerPort 60 W. Lucky this has been pretty solid over the years.

So far, I am thinking it's fine when my main bootable SSD is plugged in (BX500), and when my elements hard drive is also plugged in, it does not like it (I really need my Elements HHD as it stores a ton of media). Once the cable has arrived, I'll plug in and reveal any findings.

@RefineryX
Copy link
Author

So the able arrived but a an opps moment! I ordered the a mini USB cable rather than the micro! Should arrive on Thursday and should be able to show you what is going on at boot.

I also forgot to mention, I have another USB attached which is the conbee ii Zigbee stick which I use for my home automation system. I managed to get the UID and PID for this also and just added it to the config... made no difference however.

Here is the latest 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
BOOT_ORDER=0xf41
USB_MSD_EXCLUDE_VID_PID=105825a3,1cf10030
USB_MSD_PWR_OFF_TIME=0

@lurch
Copy link
Contributor

lurch commented Dec 16, 2020

A Zigbee stick probably doesn't appear as a USB Mass Storage Device, and so there's no need to add it to the MSD_EXCLUDE list 🙂

@RefineryX
Copy link
Author

Alright, cable arrived. I plugged it in and rebooted and here's the error:

Screenshot 2020-12-16 at 13 53 07

@timg236
Copy link
Collaborator

timg236 commented Dec 21, 2020

Please can you try the experimental bootloader on this comment #266 (comment) to see if it improves the situation.

@RefineryX
Copy link
Author

Thanks! I have uploaded this firmware and it gets passed the error screen. Now that I have a monitor, I can now see things I couldn't before. Upload booting, I noticed an error with 'Network-Manager' which looks like it was left over from some other install (Home Assistant) and I deleted it. After a few restarts, I am still facing the same issue of not being able to login to SSH after a soft-reboot (I am able to login directly on the Pi but not on another system on the network).

Fresh install: Fast forward a couple of hours, I decided to start a clean install and not configure a single thing yet to rule everything I have done out. First boot, I login via the default credentials then initiate the reboot sudo reboot. It failed on the first attempt. Normally I would remove the power, wait 10s and plug it back in and it would work. This time, I thought I would remove the ethernet cable and plug it back in and interestingly I was able to login via SSH.

Summary: I am not sure what is going on here. It seems like it just looses the connection on a soft-reboot and struggles to recover from it. Upon removing the ethernet and plugging it back in, I can again login to SSH. I can always login to SSH directly on the Pi. When in the state when I am unable to login externally... I try to ping my router via the Pi and it does not respond to pings. I remove the ethernet cable, plug it in again and suddenly everything works again.

Screenshot 2020-12-21 at 22 48 35

@RefineryX
Copy link
Author

Here's a couple of things I found out:

  1. Plugging in the hard drive and using the USB 2.0 port works.
    Appears that the problem maybe isolated to the USB 3.0 port
  2. Running mii-tool -r eth0 seems to reset and allow a connection
  3. Unplugging the ethernet cable resets the connection and allows ssh to connect agian

@lurch
Copy link
Contributor

lurch commented Dec 24, 2020

If Linux is running, then your problems with networking are a Linux-related issue rather an EEPROM-related issue, so you should probably ask for help on the Raspberry Pi forums.

@timg236
Copy link
Collaborator

timg236 commented Feb 23, 2021

The 2021-02-16 stable release now configures now configures the Ethernet PHY rxid mode in the same manner as the 5.10 Raspberry Pi OS kernel. This might improve the situation on Home Assistant.

@timg236
Copy link
Collaborator

timg236 commented Mar 10, 2021

Closed due to inactivity

@timg236 timg236 closed this as completed Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants