The Problem: HardFault within sd_softdevice_enable. With HardFault breakpoint enabled, the debugger halts at address 0x8C8. With this breakpoint disabled, breakpoints after sd_softdevice_enable are not reached.
Hardware: PCA10040 eval board (nRF52832)
Tools: Segger Embedded Studio
What works: ble_app_blinky
What doesn't work: Project attempting to recreate ble_app_blinky. I copied main.c and flash_placement.xml from ble_app_blinky. To get it to compile, I did the following:
- Added C files to the project for various libraries
- Added directories to the header search path
- Added the SoftDevice to the "Additional Load File[0]" in the Loader options
Ideas:
- The instruction before the one where it halted (0x8C6) is "bx lr", and lr has an invalid address in it (0xfffffff9).
- Single-stepping through the SVC call (in my project or ble_app_blinky) doesn't seem to work right. Is that a limitation of the SVC instruction, or are breakpoints always disabled in supervisor mode?