ARM maintains a complete toolchain for building and debugging firmware for ARM-based micro-controllers. This is the primary toolchain used by the OpenWSN team to program the following motes: |
This page details the installation steps:
You can find the ARM toolchain at https://launchpad.net/gcc-arm-embedded. Version 4.7 is the latest currently used: https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update
The installation consists in the following steps:
PATH
environment variable so Eclipse can invoke the compiler.
In Ubuntu, Add the repository for gcc-arm-embedded:
Then check your version:
|
|
/opt/eclipse
Add gnu-arm eclipse plug-in url and install the plug-in. Use the following url.
http://gnuarmeclipse.sourceforge.net/updates |
gnu-arm
plug-in is installed you can test that everything works by creating a test project.File > New > C Project
and select ARM Cross Target Application
ARM Linux GCC (GNUARM)
. If you are using Code Sourcery or Yagarto or another tool chains, select the appropriate.Finish
.Cortex M4
Move to the "assembler" option and set up the path to your gcc-arm-none/
directory. Select arm-none-eabi-gcc
If you have update your computer |
arm-none-eabi-gcc
.arm-none-eabi-gcc
.OK
to apply all changes.Create a file to test the compiler. You can toggle an LED according to your hardware specification or simply code a while loop and test the compiler.
int main(void){ int i = 0; while (i < 10) { i++; } return i; } |
Right-click on the project and select Build Project
. Based on your configuration, Eclipse invokes the ARM GCC compiler, linker, flash image creator, and size printer tools.
15:49:03 **** Incremental Build of configuration Debug for project openwsn **** make all Building file: ../src/main.c Invoking: ARM Linux GCC C Compiler arm-none-eabi-gcc -O0 -Wall -Wa,-adhlns="src/main.o.lst" -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -mcpu=cortex-m4 -mthumb -g3 -gdwarf-2 -o "src/main.o" "../src/main.c" Finished building: ../src/main.c Building target: openwsn.elf Invoking: ARM Linux GCC C Linker arm-none-eabi-gcc -nostartfiles -Wl,-Map,openwsn.map -mcpu=cortex-m4 -mthumb -g3 -gdwarf-2 -o "openwsn.elf" ./src/main.o /home/xvilajosana/Development/tools/gcc-arm-none-eabi-4_7/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008000 Finished building target: openwsn.elf Invoking: ARM Linux GNU Create Flash Image arm-none-eabi-objcopy -O ihex openwsn.elf "openwsn.hex" Finished building: openwsn.hex Invoking: ARM Linux GNU Create Listing arm-none-eabi-objdump -h -S openwsn.elf > "openwsn.lst" Finished building: openwsn.lst Invoking: ARM Linux GNU Print Size arm-none-eabi-size --format=berkeley openwsn.elf text data bss dec hex filename 44 0 0 44 2c openwsn.elf Finished building: openwsn.siz 15:49:03 Build Finished (took 114ms) |