Thursday, February 18, 2010

Stand-Alone Demos

Stand-Alone Demos can boot on any beagle board without even setting the NAND. Any SD card demo can be made Stand-Alone using a custom boot.scr file. Using this boot.scr file will enable an user to boot a demo on any beagle board without even setting the environment variables or NAND. Custom boot.scr file can also work with empty NAND.

Custom boot.scr file

In order to make custom boot.scr file you need:
1) mkimage
$ sudo apt-get install uboot-mkimage
2) vim text editor

1) create an empty text file.
2) type the format for boot.scr file in the empty text file:
NOTE: see below in Text File Format:
3) once the text file is made run this mkimage command: $ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Execute uImage.bin' -d name of the text file boot.scr
NOTE: this will create an executable file named "boot.scr"
4) Insert the SD card and mount the fat partition
$ sudo mount /dev/sdb1 /media/card
NOTE: in some versions of linux, sdb1 might be sdc1.
In order to check type $ cat /proc/partitions and look at the second last line.

5) copy the boot.scr file in the fat partition of the SD card
6) Unmount the fat partition
$ sudo umount /dev/sdb1

7) insert the SD card in the beagle board

8) hold the user button while powering on the bb

NOTE: user button is the near the SD card slot. It is towards the end of the board.
9) enjoy your Stand-Alone Demo ! ! !

Text File Format:
This is a Shell Script Format:
if fatload mmc 0 0xboot address uImage
setenv bootargs 'environment variables'
echo ***** stand-alone demo *****
bootm 0xboot address

NOTE: There has to be a space before setenv & echo
NOTE: The line "echo" above is optional. This line prints information on the screen. for example, the above line prints "***** stand-alone demo *****" on the screen.

NOTE: environment variables and boot address depends on a particular demo.
EXAMPLE: if bootcmd is "setenv bootcmd 'mmc init; fatload mmc 0 0x80300000 uImage; bootm 0x80300000'"
then the bootaddress will be 80300000.
Bootargs EXAMPLE: setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait omap.dssmode=dvi:1024x768-16@60'

Additional Resources:

Instructions regarding partitioning the SD card:

Demo images of Gnome can be found here:,com_phocadownload/Itemid,60/view,sections/

1 comment:

Jason Kridner said...

Are you saying that a .scr file is a shell script? I'd say they are simply u-boot script files, but Denx seems to agree with you.