Pumpkin, Inc.

Pumpkin User Forums


For issues specific to ARM7 and ARM9 targets, including compilers (e.g. Keil's RealView MDK) and IDEs (e.g. IAR's C-SPY).


Postby aek » Thu Oct 18, 2007 9:16 am

A Salvo user reported the following steps necessary to build C++ Salvo applications using IAR's Embedded Workbench for ARM:
... the C++ integration was quite painless. Here are some notes:

(1) set Options C/C++Compiler/Language and set to "Automatic (extension based)"

(2) for .h files that are normally intended for c++ use, but need to be included in a .c file, add the following around all all declarations (essentially around the whole file)

#ifdef __cplusplus
extern "C" {

< body of file>

#ifdef __cplusplus

This will keep the c/c++ name spaces the same. Many compile errors will result if you don't modify salvo.h and files such as board.h (hardware definitions).

Misc. notes:
* It is safe and wise to use #pragma once to ensure a .h file is included only once.
* Salvo works great in either ARM or THUMB mode. I like thumb mode very much (its faster in the Atmel AT91SAM7 due to its built-in one word I-cache, plus code is about 40% smaller). Your choice.

One other note: I can compile all files at MAX optimization (or any level you wish) except for main.cpp which seems to require NONE. I don't know why this is as this file pretty much only has the Salvo task definitions, initialization, OSSched() and tasks. If I don't turn optimization off the code gets the processes running but does with a DATA ABORT (e.g. non-aligned access). So for now I just turn off optimization for this file only by "override project defaults".


Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Return to ARM (ARM7 & ARM9)

Who is online

Users browsing this forum: No registered users and 1 guest