Booting from USBSTICK and fallback to SDcard if failed

Hi,

I searched on the internet for booting the BBB from something else
than eMMC and SDcard. I found descriptions like this one
http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-black-usb-boot/
which describe how to boot from other media.

What I miss and want to ask:
Is it possible to construct something like an "if-then'else"
construction to decide, what to boot?

I only want to boot kernel and the devicetree from different
media. The rootfs will always be on the SDcard.

It should boot like this:

If there is an USBstick attached to the BBB then
    If there is a kerne&devicetree on the attached USBstick then
        boot kernel/devicetree from the USBstick
    else
        boot kerne&devicetree from SDcard
    fi
else
    boot kerne&devicetree from SDcard
fi

Is that possible ?

Thank you very much in advance for any help!
Best regards and have a nice weekend!
Meino

Hi,

I searched on the internet for booting the BBB from something else
than eMMC and SDcard. I found descriptions like this one
http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-bl
ack-usb-boot/
which describe how to boot from other media.

What I miss and want to ask:
Is it possible to construct something like an "if-then'else"
construction to decide, what to boot?

I only want to boot kernel and the devicetree from different
media. The rootfs will always be on the SDcard.

It should boot like this:

If there is an USBstick attached to the BBB then
   If there is a kerne&devicetree on the attached USBstick then
       boot kernel/devicetree from the USBstick
   else
       boot kerne&devicetree from SDcard
   fi
else
   boot kerne&devicetree from SDcard
fi

Is that possible ?

Yes you can. If you look in default u-boot evironment, it looks for the
SDCard and if it is installed, it loads uEnv.txt, dtb file and
uImage/zImage from the SDCard. You will have to modify the uEnv.txt file
to include the USB code you found in the link above. I would suggest you
run each command manually to understand how they work and then create a
uEnv.txt file once you have a working scheme.

Regards,
John

John Syn <john3909@gmail.com> [14-02-02 02:48]:

>Hi,
>
>I searched on the internet for booting the BBB from something else
>than eMMC and SDcard. I found descriptions like this one
>http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-bl
>ack-usb-boot/
>which describe how to boot from other media.
>
>What I miss and want to ask:
>Is it possible to construct something like an "if-then'else"
>construction to decide, what to boot?
>
>I only want to boot kernel and the devicetree from different
>media. The rootfs will always be on the SDcard.
>
>It should boot like this:
>
>If there is an USBstick attached to the BBB then
> If there is a kerne&devicetree on the attached USBstick then
> boot kernel/devicetree from the USBstick
> else
> boot kerne&devicetree from SDcard
> fi
>else
> boot kerne&devicetree from SDcard
>fi
>
>Is that possible ?
Yes you can. If you look in default u-boot evironment, it looks for the
SDCard and if it is installed, it loads uEnv.txt, dtb file and
uImage/zImage from the SDCard. You will have to modify the uEnv.txt file
to include the USB code you found in the link above. I would suggest you
run each command manually to understand how they work and then create a
uEnv.txt file once you have a working scheme.

Regards,
John
>
>Thank you very much in advance for any help!
>Best regards and have a nice weekend!
>Meino
>
>
>
>--
>For more options, visit http://beagleboard.org/discuss
>---
>You received this message because you are subscribed to the Google Groups
>"BeagleBoard" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to beagleboard+unsubscribe@googlegroups.com.
>For more options, visit https://groups.google.com/groups/opt_out.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi John,

thanks for your reply! :slight_smile:

I have a LCD7 cape attached to my BBB together with some other electronic
sandwhiches and the serial connector on the BBB is not THAT easy to
access...so...is there any other way than interrupting the U-Boot boot via serial
connected terminal to get a glimpse of the default environment of the
U-Boot?

Have a nice weekend!
Best regards,
mcc