Behan Webster, Converse in Code
U-Boot is the universal bootloader used on a vast majority of embedded systems, development kits, products and so on. This session is an introduction into the U-Boot bootloader, including a hands-on part, and covers practical topics like identifying that the board is running U-Boot, accessing and exploring the U-Boot shell, including advanced scripting techniques to make life easier, obtaining information about the current hardware, accessing buses and storage and finally booting the kernel. Furthermore, since every embedded project has it’s a unique set of requirements, U-Boot customization topics are briefly touched at the end of the session.
help usbirc mailing list
mm, mncp copy memorycmp compareenv key value storage
default to compile time default
can have defaults read from somewhere
can be saved in memory
printenv print all env
env print arch
env set fookey barvaluse
env set foonowempty similar to unset foonowempty
saveenv for env persistence
run for running scripts. chain commands with ‘;’
The script environment is evaluate when set. You can escape $ to evaluate later
Special variables
Other commands
logical and conditional expression
if, ||, &&! in conditional.whilemmc, usb, sata, nandls, loadExample with SD card
mmc rescan
mmc part
# device and partition
ls mmc 0:1
load mmc 0:1 $loadaddr ID.txt
md.b $loadaddr $filesize
Loading from network
U-Boot network stack is UDP-only (no TCP)
env set
ping $serverip
tftp $loadaddr $serverip:somefile
dhcp $loadaddr $serverip:somefile
Load over serial
loadyScreen
loady
ctrl-a:exec !! sb -T yourbinary.bin
fitImage - multi component imageBooting
env set bootargs console=ttyO0,115200
load mmc 0:1 boot/dtbs/4.9.../am335x.dtb
load mmc 0:1 0x880000 boot/dtbs/4.9.../am335x.dtb
Device Tree
snippet
`images { kernel@1 { data
data = /incbin/("./arch/arm/boot/dts/...dtb")
}}
mkimage -f fitimage.its fitImage
bootm $fitimageaddr
iminfo imxtract
fdt command can maniuplate flattend device tree
qemu-system-arm -M virt -bios u-boot.bin
env set bootargs root= rootfstype= rootwait console=ttyO0,115200
mmc rescan
load mcc...
load mmc...
ALlows you to run u-boot as user application
make sandbox_defconfig
env ask mac 'MAC address ?'