Apalis iMX6 boot from USB

Hello,
does anybody have the correct environment settings to make uboot boot from USB-drive.
It seems in the Apalis-iMX Version of uboot the corresponding settings are missing because there is no usbboot or usbargs defined in the environment.

it would be very nice if anybody could give a hint regarding these settings.

Thanks in advance,
Moritz Wagner

Hello Moritz

I guess the following should do the trick:

setenv usbargs 'ip=off root=/dev/sda2 rw,noatime rootfstype=ext3 rootwait'

setenv usbboot 'run setup; setenv bootargs ${defargs} ${setupargs} ${usbargs} ${vidargs}; echo Booting from USB stick...; usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} ${boot_file} && bootm ${kernel_addr_r} ${dtbparam}'

setenv usbdtbload 'setenv dtbparam; load usb 0:1 ${fdt_addr_r} ${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true'

saveenv

And then use usb start; run usbboot to boot linux from the USB drive.


Note that if you have more than one USB drive attached the numbering of the drives is not deterministic. So one would need to do some U-Boot cmdline magic to try several drive numbers.


Regards
Max

Thanks,

this works… almost :slight_smile:
Just the root filesystem /dev/sda2 cannot be mounted, because it is not present on the stick.
To keep updates as simple as possible I’d prefer to have my RootFS as ramdisk.
Therefore I tried to produce a ram-fs but this resulted in kernel panic as well.
Maybe you can see what I’m missing, because it seems that the ramdisk doesn’t get created.

I changed the following:

setenv usbargs 'ip=off initrd=${ramdisk_addr_r},32M ramdisk_size=32768 root=/dev/ram0 rw rootwait'

with ramdisk_addr_r being:

ramdisk_addr_r=0x12100000

Besides i found out, that my fw_setenv commands do save the environment that’s printed via fw_printenv perfectly, but my real uboot environment (when performing printenv within uboot) is a different one.
Could it be, that my user space uboot commands point to a wrong partition/file somehow?

Again, thank you very much for your help!

Have a look at this one.