XMLTagsEditHistoryDiscussion

  1. Building the kernel
  2. Uploading your kernel image to the ECB_AT91

Here are the instructions that you'll use to either build your own kernel or update the kernel of the board. The latest supported Linux kernel is 2.6.21.

You need the latest darrell-loader and the latest u-boot to use this kernel.

Building the kernel

 $ wget http://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.6.tar.bz2
 $ tar xjf linux-2.6.21.6.tar.bz2
 $ cd linux-2.6.21.6
 $ wget http://maxim.org.za/AT91RM9200/2.6/2.6.21-at91.patch.gz
 $ wget http://svn.arhuaco.org/svn/src/emqbit/ECB_AT91_V2/linux-kernel/2.6.21/ecb_at91_2.6.21.patch

 $ zcat 2.6.21-at91.patch.gz | patch -p1 
 $ cat ecb_at91_2.6.21.patch | patch -p1 

We need the crosscompiler in our $PATH. Check how to cross-compile for the arm for details.

 $ export PATH=$PATH:$HOME/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/
 $ alias crossmake='make ARCH=arm CROSS_COMPILE=arm-softfloat-linux-gnu- '

Now let's configure the kernel.

 $ crossmake ecbat91_defconfig  

Now let's build the kernel. Don't forget to install libncurses5-dev (Debian) or ncurses-devel (Fedora) before. Update the kernel configuration for your needs.

  $ crossmake menuconfig

Now let's make the kernel image.

 $ crossmake -j2 vmlinux

If it finishes with no errors, now we can prepare the image to upload it.

 $ arm-softfloat-linux-gnu-objcopy -O binary -R .note -R .comment -S vmlinux linux.bin
 $ gzip -c -9 linux.bin > linux.bin.gz

You'll need to build-u-boot in order to get the mkimage binary. So once you have it you will do something like:

 $HOME/u-boot-1.1.4.patched/tools/mkimage \
       -A arm -O linux -T kernel -C gzip  -a 0x20008000 -e 0x20008000 \
       -n "Linux Kernel Image" -d linux.bin.gz ecb_at91.img

And now you can go to the next chapter (Uploading your kernel image to the ECB_AT91) and upload your shiny new kernel.

If you created modules, you'll have to compile them.

 $ mkdir /tmp/tmp-rootfs 
 $ crossmake modules
 $ INSTALL_MOD_PATH=/tmp/tmp-rootfs  crossmake modules_install

And then move the modules to their final destination (ie: your SD card).

Uploading your kernel image to the ECB_AT91

If you are building a Kernel that will be uploaded via TFTP, you can skip this step. Otherwise read on.

First, configure minicom to use the serial console. Upgrading the kernel is very easy.

You need to have installed the tools for zmodem/xmodem/ymodem file transfer (lrzsz in Debian).

Then halt the ECB_AT91 if it's already running. Reset the ECB_AT91 and wait for the following menu:

Initializing SDRAM
1: Upload loader to Dataflash with vector 6 modification.
2: Upload u-boot to Dataflash.
3: Upload linux to Dataflash
4: Start U-boot
5: Upload Filesystem image

Select 3 (Do it fast!).

Please transfer linux via Xmodem
Receiving Xmodem transfer

When you see that menu, press Ctrl + a + s and then select 'xmodem using the xmodem protocol. Then press enter and a dialog will be shown. Enter the full path of the resulting kernel image and then press the ENTER key.

A menu will be shown. Select the image (/home/n/EMQBIT/linux-2.6.14/atmel.img in my case) and upload it. Wait until it finishes, and then wait for the menu.

Note : The phase between xmodem ending download and a working prompt for booting takes a while. So wait, it's not a freeze! TODO: : Modify the Darrel's loader to warn about this :) This will save people a lot of time.

B161
Dataflash write successful
1: Upload loader to Dataflash with vector 6 modification.
2: Upload u-boot to Dataflash.
3: Upload linux to Dataflash
4: Start U-boot
5: Upload Filesystem image

Select 4 to boot your new kernel image.

Enjoy.

Last update: 2008-05-09 (Rev 468)

svnwiki $Rev: 12966 $