Nordic nRF51822 ARM Cortex-M0 Settings
by Hugh » 23 Oct 2014 20:06
Nordic nRF51822 ARM Cortex-M0 Development using emIDE Code: Select all
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.4Settings->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
Code: Select all
Global Compiler Settings - gcc 4.8.3Settings->Compiler->Toolchain Executables:
C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2013q4
Settings->Compiler->Search Directories->Compiler:
(leave blank)
Code: Select all
Project-Specific Settings - DebugProject->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 allProject->Build Options->Debug->Linker Settings->Linker script:
.\Link\gcc_nrf51_s110_xxaa.ld
Code: Select allProject->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 allProject->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 allProject->Build Options->Debug->Search Directories->Linker:
.\Link
Code: Select allProject->Properties->Debugger->GDB->GDB commands after connection:
Monitor reset
monitor flash device nRF51822_xxAA
load
Code: Select allProject->Properties->Debugger->J-Link GDB Server->Target Device:
nRF51822_xxAA
(Uncheck) Automatically close GDB Server after debugging
Code: Select allProject->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
Re: Nordic nRF51822 ARM Cortex-M0 Settings
by 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
Who is online
Users browsing this forum: No registered users and 1 guest