On Fri, Apr 8, 2016 at 12:17 PM, <[email protected]> wrote: > > Hello all, > > I have done some searching into the topic of booting from a USB on the > BBB, and have come across two general replies: > > 1) It's not possible > > 2) It's possible, but in order to do it you need to have a powered USB > hard drive to do it (wtf?) > > I wasn't convinced either of these were factually correct, so I cloned the > u-boot source, and applied the Robert C. Nelson patch set (March, 2016), > and wrote a simple Hush script inside of include/configs/ti_armv7_common.h > > Right underneath the regular boot script, I wrote this: > > "usb_boot=usb start; " \ > "if usb info; then " \ > "echo Found USB device, checking if bootable...; " \ > "else run boot; " \ > "fi; " \ > "if test -e usb 0:1 /boot/uEnv.txt; then " \ > "echo Bootable partition on USB! booting...; " \ > "setenv interface usb; " \ > "setenv bootpart 0:1; " \ > "else run boot; " \ > "fi; " \ > "run loadbootenv; " \ > "run importbootenv; " \ > "setenv cmdline ${cmdline} root=/dev/sda1; " \ > "echo Loaded boot environment from USB.; " \ > "if test -n ${cape}; then " \ > "if test -e ${interface} ${bootpart} ${fdtdir}/${fdtbase}-${cape}.dtb; > then " \ > "setenv fdtfile ${fdtbase}-${cape}.dtb; " \ > "fi; " \ > "echo using: $fdtfile...; " \ > "fi; " \ > "echo Checking if uenvcmd is set ...;" \ > "if test -n ${uenvcmd}; then " \ > "gpio set 56; " \ > "echo Running uenvcmd ...;" \ > "run uenvcmd; " \ > "fi; " \ > "echo checking for boot script; " \ > "if test -e ${interface} ${bootpart} /boot/${script}; then " \ > "gpio set 55;" \ > "setenv scriptfile /boot/${script};" \ > "run loadbootscript;" \ > "echo Loaded script from ${scriptfile};" \ > "gpio set 56; " \ > "run bootscript;" \ > "fi; " \ > "echo Running uname_boot; " \ > "run uname_boot;\0" \ > > Forgive me for the leading/trailing quotation marks, they're necessary to > get it to work inside of those header files (all of the default scripts are > written in-line as #define's). > > After implementing that, I changed BOOTENV_DEV_LEGACY_MMC to run usb_boot > instead of boot, and it seems to work like a charm. > > My question to you is this: > Is there a better way to do it that you know of? If not, is this a good > way to do it? >
That'll work fine. u-boot's on the am335x is getting to a point where we could scan usb by default.. When most people ask about "booting" from USB, the issue is: the 'bootrom' doesn't automatically init the usb bus and read from a usb flash device.. In your case, you are using u-boot, which the bootrom loaded off the microSD card, to read the usb flash device. Regards, -- Robert Nelson https://rcn-ee.com/ -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
