Nordic nRF51822 ARM Cortex-M0 Development using emIDE

Nordic nRF51822 ARM Cortex-M0 Development using emIDE

To avoid the hefty charges with commercial compilers I tried emIDE with some success; here are the settings I used for the EV Kit

Official emIDE website:

Ev Kit:

Exception Vectors

Any code compiled with a resident Soft Device has a vector table at the link address (eg, Soft Device 110 v7 requires user code to be at 0x16000, so the vector table will be at that address). The reset vector at 0x16004 will be the start address of the user code, but to debug the code must start at the reset vector in code location 0x00004, which is the Soft Device reset address. Ensure this happens by performing a device Reset before running code.

GDB Debugger

Breakpoints can be set and code single-stepped through the application startup assembler code, but currently 4.7.4 and 4.8.3 GDB crashes if setting a breakpoint in main.c. Note memory display works for both s100 Soft Device and application code and memory.

Link Files

Use the default gcc link files (eg gcc_nrf51_s110_xxaa.ld) located here: blahblah\nrf51822\Source\templates\gcc\

emIDE Default Version

gcc version 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601] (GNU Tools for ARM Embedded Processors)

**Global Compiler Settings gcc - 4.7.4**
Settings->Compiler->Toolchain Executables:
C:\Program Files (x86)\emIDE\emIDE V2.20\arm
Settings->Compiler->Search Directories->Compiler:
C:\Program Files (x86)\emIDE\emIDE V2.20\arm\arm-none-eabi\include

**Global Compiler Settings - gcc 4.8.3**
Settings->Compiler->Toolchain Executables:
C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2013q4

**Project-Specific Settings - Debug**
Project->Build Options->Debug->Policy:
Append target options to project options
Project->Build Options->Debug->Compiler Settings->Compiler Flags:
Produce debugging symbols [-g]
Project->Build Options->Debug->Compiler Settings->Other Options:
Project->Build Options->Debug->Compiler Settings->#defines:

Project->Build Options->Debug->Linker Settings->Linker script:

Project->Build Options->Debug->Linker Settings->Other linker options:

Project->Build Options->Debug->Search Directories->Compiler:
C:\Program Files (x86)\emIDE\emIDE V2.20\arm\arm-none-eabi\include

Project->Build Options->Debug->Search Directories->Linker:

Project->Properties->Debugger->GDB->GDB commands after connection:
Monitor reset
monitor flash device nRF51822_xxAA

Project->Properties->Debugger->J-Link GDB Server->Target Device:
(Uncheck) Automatically close GDB Server after debugging

Project->Properties->Debugger->J-Link GDB Server->Interface Speed:


  • I think you need to use -std=gnu99 (3rd section) to make the compilation of "system_nrf51.c" to work, because one of its dependencies (compiler_abstraction.h) uses asm keyword, which is not defined in c99.

    I tried to make the blinky example to compile in emIDE and changing it to gnu99 fixed the compilation error I had.