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
  • I've the above two changes in place. Still no luck. Here are the portions of makefile that point to these flags:

    #flags common to all targets
    CFLAGS  = -DNRF51
    CFLAGS += -DBSP_DEFINES_ONLY
    CFLAGS += -DBOARD_PCA10028
    CFLAGS += -mcpu=cortex-m0
    CFLAGS += -mthumb -mabi=aapcs --std=gnu99
    CFLAGS += -Wall -Werror -O0 -g3
    CFLAGS += -mfloat-abi=soft
    # keep every function in separate section. This will allow linker to dump unused functions
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    #CFLAGS += -flto -fno-builtin
    
    # keep every function in separate section. This will allow linker to dump unused functions
    LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
    LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
    LDFLAGS += -mcpu=cortex-m0
    # let linker to dump unused sections
    LDFLAGS += -Wl,--gc-sections
    # use newlib in nano version
    LDFLAGS += --specs=nano.specs -lc -lnosys
    
    # Assembler flags
    ASMFLAGS += -x assembler-with-cpp
    ASMFLAGS += -DNRF51
    ASMFLAGS += -DBSP_DEFINES_ONLY
    ASMFLAGS += -DBOARD_PCA10028
    #default target - first one defined
    default: clean nrf51422_xxac
    

    I see a SIGTRAP after running the code (please see the screen shot)

    image description

Reply
  • I've the above two changes in place. Still no luck. Here are the portions of makefile that point to these flags:

    #flags common to all targets
    CFLAGS  = -DNRF51
    CFLAGS += -DBSP_DEFINES_ONLY
    CFLAGS += -DBOARD_PCA10028
    CFLAGS += -mcpu=cortex-m0
    CFLAGS += -mthumb -mabi=aapcs --std=gnu99
    CFLAGS += -Wall -Werror -O0 -g3
    CFLAGS += -mfloat-abi=soft
    # keep every function in separate section. This will allow linker to dump unused functions
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    #CFLAGS += -flto -fno-builtin
    
    # keep every function in separate section. This will allow linker to dump unused functions
    LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
    LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
    LDFLAGS += -mcpu=cortex-m0
    # let linker to dump unused sections
    LDFLAGS += -Wl,--gc-sections
    # use newlib in nano version
    LDFLAGS += --specs=nano.specs -lc -lnosys
    
    # Assembler flags
    ASMFLAGS += -x assembler-with-cpp
    ASMFLAGS += -DNRF51
    ASMFLAGS += -DBSP_DEFINES_ONLY
    ASMFLAGS += -DBOARD_PCA10028
    #default target - first one defined
    default: clean nrf51422_xxac
    

    I see a SIGTRAP after running the code (please see the screen shot)

    image description

Children
No Data
Related