µracoli Manual Version foo

- µracoli
- User Guide
- Reference Guide

Compiling the Examples

The examples are located in the directory `uracoli-<version>/src/examples/`

Each example consists of a C source file, a GNUMakefile that is used for command line builds and an aps-file for Atmel AvrStudio . Here are the files, that belong to the example pgXmplHif.

        xmpl.h .................... common defines for all examples
        xmpl_hif.c ................ example source file
        xmpl_hif.aps .............. AVR Studio file
        xmpl_hif.mk ............... GNU Makefile

Command Line Build (Linux, Windows)

The example can be build with command `make -f xmpl_hif.mk TARGET`. TARGET is either all (building this example for supported boards) or the name of the board to build for (see Boards and Modules).

Here is the log for building xmpl_hif.c for the board rdk230.

    make -C install/xmpl/ -f xmpl_hif.mk rdk230
       make: Entering directory `[...]/install/xmpl'
       make -f xmpl_hif.mk BOARD=rdk230 MCU=atmega1281 F_CPU=8000000UL ./obj ./bin __xmpl_hif__
       make[1]: Entering directory `[...]/install/xmpl'
       avr-gcc -Wall -Wundef -Os -g -mmcu=atmega1281 -Wa,-adhlns=./obj/xmpl_hif_rdk230.lst -Drdk230 -DF_CPU=8000000UL -I../inc -I. -c -o obj/xmpl_hif_rdk230.o xmpl_hif.c
       avr-gcc -o bin/xmpl_hif_rdk230.elf -Wall -Wundef -Os -g -mmcu=atmega1281 -Wa,-adhlns=obj/xmpl_hif_rdk230.o -Drdk230 -DF_CPU=8000000UL -I../inc -I. obj/xmpl_hif_rdk230.o -L../lib -lradio_rdk230 -lio_rdk230
       avr-objcopy -O ihex bin/xmpl_hif_rdk230.elf bin/xmpl_hif_rdk230.hex
       make[1]: Leaving directory `[...]/install/xmpl'
       make: Leaving directory `[...]/install/xmpl'

After make did run, the files `bin/xmpl_hif_rdk230.elf` and `bin/xmpl_hif_rdk230.hex` are created. The directory `./obj` stores temporary files that are created during the build.

AVR-Studio V4.x. Build

Double click on the xmpl_hif.aps and AvrStudio starts with the project file. In the next step select "Project/Configuration Options", this opens the "Project Options" dialogue. In the section "General" there is a drop down list named "Active Configuration". Here you can select your board (see Boards and Modules).

Now click "Build" / "Build and Run" or type "Strg+F7" to build and flash the example.

The result files for the AvrStudio build are stored in the directory with the name of the selected configuration, e.g. in this case "rdk230".

Note
  Not every example is available for every board, e.g. since the board tiny23x has no UART interface, the examples that requires a HIF are not available.