Wednesday, January 16, 2008

First program for BF537 STAMP board

BF537 STAMP board is possible to buy from Digi-Key. That is a nice board with a plenty of possibilities to create a handy functionality. I just recently got one as well. My board has newer version of software that could be found on companion CD which is dated as 2005 release, but everything could be downloaded from support web site. This wiki style site looks fresh and written for creative people, check remark about documentation.


Today’s laptops or PC are quite powerful devices and capable to run multiple OS at same time by using virtualizing software. This allows of choosing Linux as development platform even if main platform is Windows XP. Check my older post on how to install SUSE 10 on Virtual PC. One of advantage of this approach is to have less hardware on a desk and more time for development.

The STAMP board is a part of the Blackfin/uClinux open source project, and the good thing that schematics for the board available as well. Board could be accessed through serial cable by using terminal window. It has an Ethernet interface, six general-purpose LEDs and four general purpose push-buttons available for quick start hardware control programming.

To be ready for development is necessary to verify number of tools to be installed on development platform. Full list of applications could be found on support site and one of them is gcc compiler. These applications are part of a standard SUSE 10 distribution. Next in a list is latest blackfin-toolchain-07r1.1-3.i386.rpm package from Blackfin support site. Double clicking an RPM file will bring up a graphical front end for installing RPM's. Under SuSE Linux 10 this front-end is provided through YaST2.



After installing the Blackfin tool chain the environment variable PATH must be modified to include the directory where the Blackfin tool chain is installed. It could be done in File Browser by selecting File->Open In Terminal and typing next command line:

export PATH=$PATH:/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-linux-uclibc/bin

At this point everything is ready for a hello world application:

#include <stdio.h>

int main() {
      printf("Hello, World\n");
      return 0;
}

Next command line will compile this file:

bfin-uclinux-gcc -Wl,-elf2flt hello.c -o hello

The output executable is 'hello' file in flat format, also it creates a file “hello.gdb” which is used for debugging. Check my next post for details on how to run this program on BF537 board.

No comments: