Nordic nRF51822 ARM Cortex-M0 Settings

Talk about the emIDE project. Experiences, reviews, tips and tricks

2 posts | Page 1 of 1


Hugh

Posts: 2
Joined: 23 Oct 2014 00:46

Nordic nRF51822 ARM Cortex-M0 Settings
Postby Hugh » 23 Oct 2014 20:06

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 Nordic nRF51822 Evaluation Kit.

Ev Kit: .nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF51822-Evaluation-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 from the debugger.

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:
blah blah\nrf51822\Source\templates\gcc\

emIDE Default Compiler 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

Code: Select all

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

Code: Select all

Settings->Compiler->Toolchain Executables:
C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2013q4
Settings->Compiler->Search Directories->Compiler:
(leave blank)



Project-Specific Settings - Debug

Code: Select all

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:
-std=c99
-mcpu=cortex-m0
Project->Build Options->Debug->Compiler Settings->#defines:
DEBUG=1
NRF51
DEBUG_NRF_USER
BLE_STACK_SUPPORT_REQD
BOARD_PCA10001


Code: Select all

Project->Build Options->Debug->Linker Settings->Linker script:
.\Link\gcc_nrf51_s110_xxaa.ld


Code: Select all

Project->Build Options->Debug->Linker Settings->Other linker options:
-mthumb
-Wl,--gc-sections
-n
-Wl,-cref
-mcpu=cortex-m0
-Wl,-Map
-Wl,${TARGET_OUTPUT_FILE}.map


Code: Select all

Project->Build Options->Debug->Search Directories->Compiler:
C:\Program Files (x86)\emIDE\emIDE V2.20\arm\arm-none-eabi\include
.\
.\Src
.\Src\nrf51822\Board
.\Src\nrf51822\Board\s110
.\Src\nrf51822\Board\s110\ble_app_YourApp
.\Src\nrf51822\Include
.\Src\nrf51822\Include\app_common
.\Src\nrf51822\Include\ble
.\Src\nrf51822\Include\ble\device_manager
.\Src\nrf51822\Include\ble\ble_services
.\Src\nrf51822\Include\gcc
.\Src\nrf51822\Include\s110
.\Src\nrf51822\Include\sd_common
.\Src\nrf51822\Include\sdk
.\Src\nrf51822\Lib
.\Src\nrf51822\Source
.\Src\nrf51822\SVD

Code: Select all

Project->Build Options->Debug->Search Directories->Linker:
.\Link

Code: Select all

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

Code: Select all

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

Code: Select all

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



This is a repost as the first attempt didn't show; hopefully it isn't duplicated. Any feedback on the GDB crash issue would be appreciated.
Hugh

Top


emIDE
Site Admin

Posts: 221
Joined: 03 Jul 2012 10:20

Re: Nordic nRF51822 ARM Cortex-M0 Settings
Postby emIDE » 21 Jan 2015 10:23

Hi,

Thank you for sharing this information.

The settings in general look good, so I do not see why GDB should crash.
But this might be somehow generically related to GCC/GDB.

Best regards
Johannes - emIDE

Top



2 posts | Page 1 of 1


Jump to:


Who is online

Users browsing this forum: No registered users and 1 guest