Hello,
Two years ago I develop a board with a nrf51822. Right now I'm trying to use the same board again. I installed the new SDK 12.3.0, GCC ARM, nrf command line tools and JLink to setup the development environment on OSX.
I got no problems on compile the blinky (I choose PCA10028 board) example and flash it (make flash) to the board however it looks like the CPU is not running.
The blinky example is set up for nrf51422 so I change the makefile for nrf51822 but the problem persist.
Reboot my PC on windows, installed keil 5 and SDK10, that time I build the blinky example for board PCA20006, load it with keil to board and it worked. EDIT: download the SDK12.3.0 on windows open the same blinky example on keil, flashed and it worked. So it is a problem with armgcc. I'm using the following version: gcc-arm-none-eabi-4_9-2015q3
Reboot again into OSX, start the GDB server:
JLinkGDBServer -family nrf51 -device nrf51822 -if SWD
Run the arm gdb:
./arm-none-eabi-gdb
target extended-remote :2331
break main
monitor reset
on the JLink window I can see Starting CPU... but it doesn't stop at main...
What should I do debug the problem?
some gdb output:
(gdb) monitor reset
Resetting target
(gdb) c
Continuing.
Breakpoint 1, 0x00001366 in HardFault_Handler ()
(gdb) bt
#0 0x00001366 in HardFault_Handler ()
#1 <signal handler called>
#2 0x00000000 in __isr_vector ()
#3 0x00000000 in ?? ()
(gdb) info register
r0 0x0 0
r1 0x1540 5440
r2 0x20000000 536870912
r3 0x0 0
r4 0xffffffff 4294967295
r5 0xffffffff 4294967295
r6 0xffffffff 4294967295
r7 0xffffffff 4294967295
r8 0xffffffff 4294967295
r9 0xffffffff 4294967295
r10 0xffffffff 4294967295
r11 0xffffffff 4294967295
r12 0xffffffff 4294967295
sp 0x20007fe0 0x20007fe0
lr 0xfffffff9 4294967289
pc 0x1366 0x1366 <HardFault_Handler>
xpsr 0x61000003 1627389955
msp 0x20007fe0 536903648
psp 0xfffffffc 4294967292
primask 0x0 0
basepri 0x0 0
---Type <return> to continue, or q <return> to quit---
faultmask 0x0 0
control 0x0 0
(gdb)