How to add a new radio board to the library

The following section illustrates how to add your own radio board to the µracoli build process, For illustration of the steps, the board tiny230 from DL8DTL is used.

Create two board identifiers.
Select a short and a long name for the board.

The short name should contain 4 ... 8 lower case letters and numbers, e.g. tiny230. It is used for naming the board in the scons build process (scons tiny230) and identifying the generated libraries and executables (ls install/*/*_tiny230.*).

The long name should contain 12 ... 16 upper case letters and numbers and underlines, e.g. TINY_230. It is used as symbolic name for a unique board identifier, defined in Src/Lib/Inc/const.h.

Create a board abstraction header file
The board abstraction header file (e.g. Src/Lib/Inc/boards/board_tiny230.h) defines macros for accessing the ressources of the radio board, such as SPI and GPIO pins.

The board abstraction header files are located in the directory Src/Lib/Inc/boards.

Before you start to write your own board abstraction file from scratch, have a look into the already existing files. Either you copy one of the existing files and modify it or you simply add an alias to an existing board. See board_rbb.h for an example, how the aliases rbb230, rbb231 and rbb212 are handled.

The alias method should always used, if the boards belongs to the same family and are rebuilds/clones of existing ones, but should have a new name.

Modify const.h
Add the long name to the file Src/Lib/Inc/const.h and give it a unique number.

Todo:
Check to use an enum instead of a define in order to avoid non uniqeness of the assigned numbers.
Src/Lib/Inc/const.h #define  ZGB_LINK_231    (51) 
Src/Lib/Inc/const.h #define  ZGB_LINK_212    (52) 
Src/Lib/Inc/const.h
Src/Lib/Inc/const.h /* DIY and wirewrap projects */
Src/Lib/Inc/const.h #define  TINY_230        (90) 
Src/Lib/Inc/const.h #define  STK500_MEGA8    (91) 
Src/Lib/Inc/const.h #define  STK500_MEGA16   (92) 

If your newly added radio board uses a MCU, that is not yet used, you also need to add a unique define

Add the board to the file board.cfg
Add a configruation section to Src/Lib/Inc/boards/board.cfg.

[tiny230]
aliases    = tiny231
comment    = Joerg's (DL8DTL) ATtiny44 with AT86RF230
include    = boards/board_tiny230.h
cpu        = attiny84
bootoffset = 0x0
ccflags    =
f_cpu      = 8000000UL
no_app     = diag rdiag wuart wuart2 sniffer
no_xmpl    = xmpl_keys xmpl_key_events xmpl_hif xmpl_hif_echo
             xmpl_radio_stream

Parameters:
[sectionname] This is name of the board, it must be a unique among all board and alias names.
aliases A space seperated list of aliased derivates of this board
comment The comment is displayed when scons -h is used.
include Name of the board abstraction header file.
cpu MCU name which is used in mmcu option of avr-gcc.
bootoffset Location address of the boot loader.
ccflags Additional compiler parameters, like -I or -D options.
f_cpu MCU clock frequency
no_app applications that should be excluded from the build, e.g. due to the lack of ressources.
no_xmpl examples that should be excluded from the build, e.g. due to the lack of ressources.
more_xmpls board specific example applications.
Build the software of the new radio board
scons install\inc\board_cfg.h
scons tiny230


This documentation for µracoli was generated on 21 Jan 2010 by  doxygen 1.5.5