Thursday, January 31, 2008

Compiling the Kernel for BF537

BF537 STAMP board has buttons and LEDs provided to be accessed by software for testing purpose. In order to do that is required to have customized kernel image. Default image for BF537 has no driver for such operations.

Source code for uClinux kernel could be downloaded from blackfin site. There are an easy way to uncompress it by just right click on a file in SUSE File Browser and selecting Extract Here. Lets open this folder and configure blackfin toolkit used for kernel compilation. Details on how to do that is provided in previous post.

Next command in terminal window will invoke kernel configuration utility.

make menuconfig

Choosing BF537-STAMP in Vendor/Product Selection will produce kernel for BF537. It is important to do that, otherwise kernel image will halt on boot up execution.



Ability to add required driver is provided with selection of Customize Kernel Settings (NEW):

Kernel/Library/Defaults Selection.
Device Drivers --->
Character devices --->
[*] Blackfin BF53x Programmable Flags Driver


Exit and saving configuration will bring back the terminal console. Executing next commands will reset cached objects and make a new kernel image:

make clean
make

The compilation process will take time and could last for about 30 minutes. BF537 U-Boot loader has a nice feature of loading kernel from a network over tftp. SUSE YaST in a few steps allows to configure TFTP server and then copy kernel image into server folder with File Browser.

Now let’s jump to Windows XP host environment and start HyperTerminal application.


For tftp command to work is necessary to configure BF537 U-Boot environment with ipaddress for tftp server and BF537. Saving environment settings into flash memory is an optional step. After that is loading kernel image to memory and booting uClinux.

BF537> setenv ipaddr x.y.z.n
BF537> setenv serverip x.y.z.m
BF537> saveenv
BF537> tftp 0x1000000 linux
BF537> bootelf 0x1000000

Now everything is ready to run test application on a custom kernel image. Source code for button test application could be found in user\blkfin-test\pflags-test subfolder where kernel was compiled. Check my previous post on how to compile and download application into BF537.

No comments: