Re: Boot from USB on RPi4 8GB?

From: Mark Millard via freebsd-arm <freebsd-arm_at_freebsd.org>
Date: Thu, 10 Jun 2021 19:57:39 -0700
On 2021-Jun-10, at 17:22, William Carson via freebsd-arm <freebsd-arm at freebsd.org> wrote:

> On May 30, 2021, at 6:54 PM, William Carson via freebsd-arm <freebsd-arm_at_freebsd.org> wrote:
>> 
>>> 
>>> On May 30, 2021, at 4:08 PM, Mark Millard <marklmi_at_yahoo.com> wrote:
>>> 
>>> On 2021-May-30, at 13:50, Mark Millard via freebsd-arm <freebsd-arm at freebsd.org> wrote:
>>> 
>>>> On 2021-May-30, at 10:59, William Carson via freebsd-arm <freebsd-arm at freebsd.org> wrote:
>>>> 
>>>>>> . . .
>>>>>> I use a USB3 SSD that has small enough power requirements
>>>>>> to not require a powered hub. (I also use a 5.1V 3.5A
>>>>>> power supply as part of that context.) I've never tried
>>>>>> spinning rust or higher powered USB3 media.
>>>> 
>>>> I view the power supply that I use as just giving a little
>>>> more margin,  not as a way to increase what the devices
>>>> total to.
>>>> 
>>>>> . . . I'm not sure what's considered "high powered" but the Samsung tech specs say this particular model uses 5.7 W on average and 10.0 W maximum. But it does seem curious that the Raspberry PI OS will boot this disk without issue, so I don't think it's the drive. I also tried a Samsung 950 PRO using a different enclosure (QNINE NVME Enclosure, M.2 PCIe SSD (M Key) to USB 3.0 External Case), but it behaved the same.
>>>> . . .
>>>> 
>>>> Then you need to use a powered hub for that device.
>>> 
>>> I should have just referred to independent power. You
>>> had written:
>>> 
>>> QUOTE
>>> I'm trying to use a SAMSUNG (MZ-V7E500BW) 970 EVO SSD 500GB - M.2 NVMe, attached via the Geekworm X872 M.2 NVMe 2280/2260/2242/2230 SSD Expansion Board.
>>> END QUOTE
>>> 
>>> https://geekworm.com/products/raspberry-pi-4-x872-m-2-nvme-2280-2260-2242-2230-ssd-expansion-board
>>> 
>>> shows that it has its own power connector and has an image
>>> that says "please power x872 via DC Jack of XH2.54 connector
>>> if SSD is not recognized or low power". Later text on the
>>> page says:
>>> 
>>> QUOTE
>>> Specifications:
>>> Power Supply
>>> 	• 5Vdc +/-5% , Powered by Raspberry Pi USB port
>>> 	• 5Vdc via DC power jack or XH2.5 connector, Extra power for the SSD
>>> END QUOTE
>>> 
>>> So, if I gather right, you need to connect a power
>>> supply to the X872 and another to the RPi4B.
>>> 
>>> Another image says "Note: NOT recommended to use SAMSUNG SSD,
>>> if use SAMSUNG SSD, please close WiFi". Later text on the page
>>> says the same.
>> 
>> A-ha, indeed. I just noticed that as well. I've gone ahead and ordered a supplementary power supply and a lower-power NVMe to do more testing. I'll send an update once I've received and tested them.
>> 
>> Thank you for hopefully pointing me in the right direction.
> 
> Alright, so, I ended up buying a WDS500G2B0C, which seems to only use a maximum of 75 mW (this seems ... low, to say the least, but the column is unlabeled in the spec sheet I found here https://documents.westerndigital.com/content/dam/doc-library/en_us/assets/public/western-digital/product/internal-drives/wd-blue-nvme-ssd/product-brief-wd-blue-sn550-nvme-ssd.pdf).

That document says for WDS500G2B0C:

QUOTE
Maximum Operating power    3.5W
END QUOTE

So at about 5V: about 0.7A maximum. Of itself, that is under the 1.2A
figure. The X872 must take some power as well. But I do not find any
W or A specifications for it.

I do not know what other power draws in the overall system might be.
Any combination that might use more than about 0.5A? (So: more than
about 2.5W total)?

Unless you specify otherwise, I'm going to presume: no. So I'm not
expecting power to be a problem.

> Sadly, it also would not boot from either of my NVMe-USB adapters.

Is the failing behavior identical to before? If not, what
evidence is it now producing when trying to boot? ("would
not boot" leaves open all possible ways of failing.)

You previously reported getting:

QUOTE
scanning bus xhci_pci for devices... Device NOT ready
   Request Sense returned 02 04 01
END QUOTE

Someone else recently was getting that and got around
the problem while trying 3 U-Boot extra steps. They
are listed below and I leave in the indication of which
happened to work in that context. The point is to
establish a configuration setting before U-Boot tries to
scan the USB buses looking for the storage media.
Otherwise a "usb reset" would need to happen after
making the configuration change.

QUOTE
> Looking around on the web I see reports of the:
> 
>  Request Sense returned 02 04 01
> 
> (and the matching Device NOT ready) mean that the
> problem will occur and that repeating usb start
> or usb reset again until it does not report that
> leads to things working.
> 
> But I've also seen other, more complete information
> indicating that there is a environment setting
> (showing an example value):
> 
> usb_ready_retry=5
> 
> to set up before the usb restart (or usb start)
> command. It deals with the issue more explicitly
> for slow devices.
> 
> Another one is (units: msec):
> 
> usb_pgood_delay=10000
> 
Presto! using editenv usb_pgood_delay prompted for input, typing 10000
and hitting return set the value and the disk was found.

It looks like the setting can only be saved to microSD. With
no card saveenv reports
Saving Environment to FAT... Card did not respond to voltage select!
Failed (1)

> There are also device that have problems with
> large transfers and require extra protocol to
> deal with transfer problems before they will
> work again, U-Boot not doing that.
> 
> usb_max_blk=20
> 
> sets a old historical value that generally
> just works for such devices form what I read.
> 
> I see no indication that other usb commands are
> worthwhile until one has avoided that "Request
> Sense returned 02 04 01" message for usb reset
> (a.k.a. usb start).
> 
> The reports of this sort of thing are not limited
> to RPi's and go back to at least 2014.
> 
> If I understand correctly, usb_ready_retry and
> usb_pgood_delay and usb_max_blk are part of
> normal U-Boot builds these days. But I'm not
> certain of that.

END QUOTE


> After a while of getting frustrating forgetting which combination of image + usb adapter + drive configuration I had or hadn't tried, I thought to myself.. what would happen if I tried one of the USB2 ports? Bingo! It booted FreeBSD no problem.
> 
> So I'm not sure what exactly that means, except that I know the power/usb adapter/drive/image is not the issue.

For the new device, anyway.

> I don't think I really "need" the performance improvement of the USB3 port at the moment, but maybe that's something that will help troubleshoot the issue? It would certainly be nice to use little USB bridge pcb "cable" to have a neater installation though.
> 
> Any ideas?

See above.

>>> https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md
>>>> lists:
>>>> 
>>>> "Maximum total USB peripheral current draw" as: 1.2A ,
>>>> which at 5.1V is 6W.

I either should have listed 5V or instead have
listed 6.12W.

>>>> That figure is the total for all USB devices attached
>>>> that are not powered independently.
>>>> 
>>>> That document also says that a 5.1V supply is required,
>>>> not 5V.
>>>> 
>>>> The power supply that the RPi folks supply is 5.1V _at_ 3A
>>>> or 15.3W. Even the 5.1V 3.5A power supply that I use
>>>> only multiplies out to 17.85W.
>>> 
>> 


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
Received on Fri Jun 11 2021 - 02:57:39 UTC

Original text of this message