As I have recently left out the first main part – compiling and installing the bootloaders of the pandaboard – I will add it in here.
So after unpacking the pandaboard, my first intention was to update all available bootloaders. Though I recently also ordered a Beagleboard, i knew already what to do. OMAP platforms are nearly equivalent in this case because all are produced (or are still I should say if Broadcom really wants to buy TI) by Texas Instruments.
Long story short: There is plenty of information about bootloaders for OMAP platforms spread across the web but I strangled because I had different sources, some patched, some not and a lot of work with the SD card format. Well there are several tutorials for that part, but that doesn’t mean that it’s easy…
So the main mechanism for booting up the Pandaboard are simply 4 Steps:
X-Loader (first bootloader) -> U-Boot (second bootloader) -> Kernel -> Root Filesystem
Because the pandaboard doesn’t have any NAND memory chips onboard, you will need to use a separate SD Card for bootloaders. You can also locate the rootfs on that SD card, but look out that you get at least a 8 der 16GB large which is at minimum specified as class 10 – Or your system will run very sluggish! (which made me depressive at one point, so I switched to sandisk extreme III)
Notice: Though the pandaboard is a ARM based device, you will have to set up a cross compiling toolchain for this. There is another entry on how to do this . I’m assuming for the following commands, that you have added the toolchain directory to your PATH environment variable with i.e.:
Step 1: SD Card Format
To make it as fast and easy as possible, some clever guy wrote the omap3-mkcard.sh script. This makes it pretty simple: Get it, insert your SD Card, make sure to check using “dmesg” that it is loaded/available and check the path (i.e. sdb/sdc/sdd…)
Maybe you check
sudo apt-get install kpartx bc
to make sure you have all needed commando tools.
Then simply execute it with (I’m using sdb as path here)
sh omap3-mkcard.sh /dev/sdb
and it will do everything for you. If you get some errors about unknown commandos, check the web and install the needed packages that give you those commands/programs.
It can also be possible that you will get some errors. In my case it was because of a missing dd command or whatever and the partition table on the SD Card got corrupted. To reset the partition table simply do a
The command “o” will create a new DOS like partition table. After that, everything worked fine for me.
If you are having trouble with preparing the SD Card, have a glance at the SD Configuration over at OMAPPedia.
Step 2: Compile X-Loader
X-Loader is the small bootloader from TI which just initializes basic features of the board itself. X-Loader is kind of limited and so it simply prepares the hardware and loads U-Boot for further commands. How the complete process works is pretty well explained by the guys over at OMAPPEDIA.
To get the X-Loader sources simple get it via git
git clone git://gitorious.org/pandaboard/x-loader-mainline.git
enter the directory and load the default pandaboard config with
make CROSS_COMPILE=arm-none-linux-gnueabi- omap4430panda_config
Now create the binary with
make CROSS_COMPILE=arm-none-linux-gnueabi- ift
It should now lie in the same directory as the sources, named “MLO”. At the moment, the newest version is 1.5.1.
Step 3: Compile U-Boot
Now you have to compile U-Boot from its sources. Either you choose the official U-Boot release tgzs/git or you use the git tree from the same gitorious account:
git clone git://gitorious.org/pandaboard/u-boot-mainline.git
Then create the config from the default config
make CROSS_COMPILE=arm-none-linux-gnueabi- omap4_panda_config
and in the last step build the binary again with
make USE_PRIVATE_LIBGG=yes CROSS_COMPILE=arm-none-linux-gnueabi-
If you are using the latest U-Boot git from denx, then you will get an error atm (20.08.2011) about a too huge cluster size of the SRAM part. There is already a patch available here which will hopefully will be soon upstream. To use it, copy everything to a textfile (i.e. using vim and name it SRAM.patch) and execute it via
patch -p1 < SRAM.patch
There should now be a file called u-boot.bin flying around in the same directory…
A really good reference about U-Boot and X-Loader is the guy over at elinux.org, check it out!
U-Boot is a relly nice tool and THE bootloader available. Fun fact is, that it’s creator lives in the town next to mine and I’m hopefully looking forward to drink a cup of coffee with him one day.
Step 4: Kernel
To boot up you also need a kernel. You can build your own or use a precompiled one, whatever you like. For my project i needed some adjustments and stuff, so I chose to build it by myself. I chose the latest version (3.0.2 to that point) due to a few OMAP bugfixes in there. You can read about the progress and my config in the other blog entry here. You can also download the precompiled binary there for a quickstart…
Step 5: Root Filesystem
To do anything useful with your device, you’ll also need a root filesystem. There are various options on the web on how to get one… i.e. you can use the angstrom one or, what I did, create your own with the great buildroot suite. This is really a very well designed and up to date suite to build and deploy filesystems of any kind. I will write another article about that later…
Step 6: Finalize SD Card
The final part is to copy everything over to your in step 1 already prepared SD card. Now comes the important part: The order is the key! The script created you 2 partitions, one for the bootloaders/kernel and one for the filesystem. You can also boot the kernel from the second partition or load the filesystem over the network via NFS as explained here.
- The first file you need to copy is the “MLO” from X-Loader. This HAS TO BE the first file as it is the primary bootloader and the system just looks on the first few cluster on the SD Card to find it!
- The second file is the “u-boot.bin” and the third file is the kernel, “uImage”.
- The root system has now to be untared to the second partition or the NFS server needs to be configured
This should be it for the start. Put your SD Card in the slot of your pandaboard, connect a serial cable/USB-Serial adapter to the pandaboard and power it up. You should now see the loading screens of X-Loader, U-Boot and the kernel! After 30 seconds, the rootfs should be loaded und you should be able to login. Have fun!
If theres something wrong/trouble or there is a way how I can do anything smarter, just drop me a comment. I’m open for every single advice!