Tuesday, December 21, 2010

Beagleboard-xM - Using TFTP To Load Images

All Beagleboard-xM's owners may already known, it's impossible using u-boot to load image into uSDCard or RAM, so far. This's no matter if you do not frequently changing the image but really a trouble if your job needs to do. So, if the u-boot cannot do, why don't let the kernel and busybox does. If you like it, please follow few steps below:

LAMP: By using:
o Kernel which supports mmc driver and ethernet driver
o tinyfs_loader which provides tftp command

Step 1: Setup environment
o A beagleboard-xm with uSDCard
o An tftp, nfs server

Step 2: Install kernel and tinyfs_loader (including busybox)
o A bootable uSDCard/vfat partion, x-loader & u-boot should be there. Still need u-boot, sure :D
o Download an uImage_loader and a tinyfs_loader from there
o Put the uImage_loader to uSDCard/vfat, tinyfs_loader to nfs server (extract tinyfs_loader as sudoers)

Step 3: Change as needed
o loadimage.tftp script in tinyfs_loader is called by init.rc
o Please modify this script as needed. At minimum you should change uImage name and tftp server IP
o By default, after loading image, loadimage.tftp calls to reboot

Step 4: In action
o For loading image, the bootcmd and bootargs should be something like this
# setenv bootcmd 'mmc init; fatload mmc 0 0x80000000 uImage_loader; bootm 0x80000000;'
# setenv bootargs console=ttyS2,115200n8 rootfs=/dev/nfs rw init=/init nfsroot=${SERVER_IP}:/srv/tinyfs_loader ip=${BOARD_IP}

EOL:
o Depend on your habit of using u-boot script, this loading ciruit could be very convenient and fast
o It's possible to get back the image from uSDCard to tftp server