• Scripting u-boot commands

    From bob prohaska@3:770/3 to All on Mon Nov 29 00:28:33 2021
    Is it possible to implement a script to be execuated by u-boot
    in place of the default behavior? What's needed is something like

    while true do
    usb reset
    if USB storage found
    run bootcmd_usb0
    else
    repeat.....

    So far it has taken between one and ten cycles of usb reset to find
    the usb mass storage device when these commands are run by hand.

    Thanks for reading,

    bob prohaska
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Deloptes@3:770/3 to bob prohaska on Mon Nov 29 08:24:56 2021
    bob prohaska wrote:

    So far it has taken between one and ten cycles of usb reset to find
    the usb mass storage device when these commands are run by hand.

    usually you set a delay to give time so that the hardware initializes, but I
    am speaking from theory - never tried USB boot on the RPi
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to Deloptes on Mon Nov 29 16:11:46 2021
    Deloptes <deloptes@gmail.com> wrote:
    bob prohaska wrote:

    So far it has taken between one and ten cycles of usb reset to find
    the usb mass storage device when these commands are run by hand.

    usually you set a delay to give time so that the hardware initializes, but I am speaking from theory - never tried USB boot on the RPi

    Yes, that's the customary practice. I've turned on all the delays I know
    about (timeout file, usb_pgood_delay, program_usb_boot_timeout=1, boot_delay_ms=5000, boot_delay=5000) and none seem to make any
    consistent difference. I'm guessing it's a half-bug in some of my
    hardware. Sometimes the disk shows up on the second try, sometimes
    the fifth or sixth. So far, it hasn't taken many more than six tries.

    The most encouraging thing found so far is http://etutorials.org/Linux+systems/embedded+linux+systems/Chapter+9.+Setting+Up+the+Bootloader/9.5+U-Boot/

    but it's quite old, apparently dating back some ten years.

    It rather implies one can set environment variables in config.txt,
    those are tantamount to commands in the "hush" shell implemented
    by u-boot. It's much less clear whether the hush shell implements
    enough to parse the response to usb reset for the text "1 storage",
    break out of the loop and run bootcmd_usb0.

    Thanks for reading,

    bob prohaska
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Jim Jackson@3:770/3 to bob prohaska on Mon Nov 29 20:18:03 2021
    On 2021-11-29, bob prohaska <bp@www.zefox.net> wrote:
    Is it possible to implement a script to be execuated by u-boot
    in place of the default behavior? What's needed is something like

    while true do
    usb reset
    if USB storage found
    run bootcmd_usb0
    else
    repeat.....

    So far it has taken between one and ten cycles of usb reset to find
    the usb mass storage device when these commands are run by hand.

    Thanks for reading,

    bob prohaska


    I've never had problems booting a RPI from USB attached mass storage -
    but theb again I've never used uboot - I've only ever used the
    RaspberryPi foundations bootloader. Is there any special reason
    you have to use uboot?
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to Jim Jackson on Mon Nov 29 20:55:56 2021
    Jim Jackson <jj@franjam.org.uk> wrote:

    I've never had problems booting a RPI from USB attached mass storage -
    but theb again I've never used uboot - I've only ever used the
    RaspberryPi foundations bootloader. Is there any special reason
    you have to use uboot?

    To the best of my knowledge RasPiOS uses u-boot, which then
    starts the Linux bootloader chain. If I'm wrong that might be
    part of my problem.

    I happen to be booting FreeBSD, but the problem of finding a
    usb mass storage device arises earlier in the boot chain.

    Thanks for reading,

    bob prohaska
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Jim Jackson@3:770/3 to bob prohaska on Mon Nov 29 22:12:39 2021
    On 2021-11-29, bob prohaska <bp@www.zefox.net> wrote:
    Jim Jackson <jj@franjam.org.uk> wrote:

    I've never had problems booting a RPI from USB attached mass storage -
    but theb again I've never used uboot - I've only ever used the
    RaspberryPi foundations bootloader. Is there any special reason
    you have to use uboot?

    To the best of my knowledge RasPiOS uses u-boot,

    Why do you think that?

    The "standard" Raspbian boot sequence is described at

    https://raspberrypi.stackexchange.com/questions/10442/what-is-the-boot-sequence

    The definitive documentation is at

    https://www.raspberrypi.com/documentation/computers/raspberry-pi.html

    But I suspect that the FreeBSD people have gone with the independent uboot implementation for the Pi. Is there a FreeBSD forum or users email list?
    You might find better help there.

    which then
    starts the Linux bootloader chain. If I'm wrong that might be
    part of my problem.

    I happen to be booting FreeBSD, but the problem of finding a
    usb mass storage device arises earlier in the boot chain.

    Thanks for reading,

    bob prohaska


    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Mike Scott@3:770/3 to bob prohaska on Tue Nov 30 08:35:11 2021
    On 29/11/2021 20:55, bob prohaska wrote:
    Jim Jackson <jj@franjam.org.uk> wrote:

    I've never had problems booting a RPI from USB attached mass storage -
    but theb again I've never used uboot - I've only ever used the
    RaspberryPi foundations bootloader. Is there any special reason
    you have to use uboot?

    To the best of my knowledge RasPiOS uses u-boot, which then
    starts the Linux bootloader chain. If I'm wrong that might be
    part of my problem.

    I happen to be booting FreeBSD, but the problem of finding a
    usb mass storage device arises earlier in the boot chain.

    I wonder if that's the issue I had. The pi's in bits atm so I can't
    check, but I had to set a timeout (kern.cam.boot_delay I think; I was
    getting in a dreadful muddle at the time) in loader.conf to some huge
    value, around 10sec iirc. Otherwise it couldn't mount the root device.
    But it was all muddled up with my ignorance plus a dying hd so ymmv.



    Thanks for reading,

    bob prohaska




    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to bob prohaska on Tue Nov 30 13:23:41 2021
    On 29/11/2021 00:28, bob prohaska wrote:
    So far it has taken between one and ten cycles of usb reset to find
    the usb mass storage device when these commands are run by hand.

    Is the power supply adequate for the device? Does this occur with a
    powered hub?

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)