This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Debugging blinky example with GNU Eclipse with SDK7.x

I'm trying to debug the blinky example with SDK 7.1 using Eclipse Luna. Going through several threads here I could figure out configurations needed and build the app. I can download the app through nRF studio and it works fine. However the issue comes while debugging. I get the following error (see screen shot) while I hit run.

Following is the error on J-link console. Application has been compiled with -O0 -g3 flags

SEGGER J-Link GDB Server V4.96 Command Line Version

JLinkARM.dll V4.96 (DLL compiled Dec 22 2014 09:51:48)

-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 nRF51422_xxAC
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Nov 28 2014 10:32:04
Hardware: V1.00
S/N: 681110165
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Read 1 bytes @ address 0x00000000 (Data = 0xFF)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0xFFFFFFFE)
R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF
R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF
R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF
R12= FFFFFFFF, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= FFFFFFFC
R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Select auto target interface speed (1000 kHz)
Flash breakpoints enabled
Semi-hosting enabled (VectorAddr = 0x08)
Semihosting I/O set to TELNET Client
Downloading 1200 bytes @ address 0x00000000 - Verified OK
Downloading 8 bytes @ address 0x000004B0 - Verified OK
Downloading 100 bytes @ address 0x000004B8 - Verified OK
Writing register (R8 = 0x00000439)
Read 1 bytes @ address 0x00000439 (Data = 0x21)
Read 1 bytes @ address 0x00000439 (Data = 0x21)
Read 1 bytes @ address 0x00000439 (Data = 0x21)
Read 1 bytes @ address 0x00000439 (Data = 0x21)
Reading 14 bytes @ address 0x00000439
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Reading 14 bytes @ address 0x0000033C
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Reading 14 bytes @ address 0x0000033C
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Reading 14 bytes @ address 0x0000033C
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Reading 14 bytes @ address 0x0000033C
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Read 1 bytes @ address 0x0000033C (Data = 0x80)
Resetting target
Halting target CPU...
...Target halted (PC = 0x00000438)
R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF
R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF
R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF
R12= FFFFFFFF, R13= 20008000, MSP= 20008000, PSP= FFFFFFFC
R14(LR) = FFFFFFFF, R15(PC) = 00000438
XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Setting breakpoint @ address 0x0000033C, Size = 4, BPHandle = 0x0002
Starting target CPU...
...Breakpoint reached @ address 0x0000033C
Reading all registers
Removing breakpoint @ address 0x0000033C, Size = 4
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00)
Read 1 bytes @ address 0xFFFFFFFF (Data = 0x00) 

image description

Parents
  • Makefile.common is decprecated in SDK v.7+, and the project makefiles are now standalone. Some of the other changes are that they no longer have the debug target and it's compiled as release with optimization by default. In order to enable debugging you need to replace the -O3 option with -O0 and add -g3 in cflags to include debug symbols. The CFLAG variable should therefore be set like this CFLAGS += -O0 -g3.

    You also need to comment out the -flto optimization. Otherwise the debug symbols will be removed from the compile: #CFLAGS += -flto -fno-builtin

Reply
  • Makefile.common is decprecated in SDK v.7+, and the project makefiles are now standalone. Some of the other changes are that they no longer have the debug target and it's compiled as release with optimization by default. In order to enable debugging you need to replace the -O3 option with -O0 and add -g3 in cflags to include debug symbols. The CFLAG variable should therefore be set like this CFLAGS += -O0 -g3.

    You also need to comment out the -flto optimization. Otherwise the debug symbols will be removed from the compile: #CFLAGS += -flto -fno-builtin

Children
No Data
Related