[Tinyos-8051wg] porting tinyos on 8051
Steve Jones
steve at istech.demon.co.uk
Mon Jul 10 03:56:21 PDT 2006
Hi,
I'm running TinyOS on an 8051 target. So far I have the Blink and Surge
apps running.
I'm new to TinyOS and I was a bit nervous at first since the level of
interest for the 8051 is low.
I use the Perl script:
./contrib/diku/mcs51/tools/sdccMangleAppC.pl
It seems to works quite well.
I also use the eclipse/tinyos plugin:
http://www.dcg.ethz.ch/~rschuler/articles/tutorial_wizard.htm
I build my tinyOS applications in eclipse and then in a cygwin window I
run the sdccMangleAppC.pl script.
The way it works is you use the standard TinyOS AVR tool chain to generate
app.c. Then sdccMangleAppC.pl converts this to an 8051 compatible source
file that you stuff up a SDCC or KIEL compiler.
I then debug, single step and add breakpoints using the normal KIEL
environment.
I've never run tinyOS on a supported target so I cannot say how painfull
targeting the unsupported 8051 is by comparison.
The hardest part so far has been modifying/rewriting hardware.h to map
onto my own hardware. You end up knee deep in TOS_XXX macro expansions. I
have a hatred of macros so I found this a real pain.
My approach has been to create my own TOS 8051 target source tree in an
eclipse/tinyOS project, eg:
./contrib/my8051/tos/...
I modified the eclipse tinyOS project Makefile so the ncc includes point
to the my8051 source tree. Then, using the Blink application for openers,
I slowly populated the source tree with modified versions of the source
from the standard TOS tree.
It's taken me about three weeks so to get to a position that I'm
comfortable with. I'm a TinyOS newbie remember. Looking back at what I've
had to do I'd say a TinyOS expert would manage it in a few days.
Cheers, Steve.
More information about the Tinyos-8051wg
mailing list