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

Problem running/debugging nRF51822 GCC example project

Hello. I'm trying to start developing with the nRF51822 Eval kit with Eclipse and ARM GCC but I ran into some problems when trying to run the ble_app_hrs_example. I've been trying to solve it for the past two days but I'm pretty much out of ideas now so any help would be appreciated.

I installed and set-up everything the way it's described in the application note and flashed SoftDevice onto the eval board. The example program compiles without errors but when I try debugging I get strange behavior - I can step into and over lines of code, but the program doesn't stop at any breakpoints I set. In fact I get the following line (in red color) in the console every time I try to set a breakpoint:

Try to add breakpoint - No source file named C.

Another problem is that after I run he debugging session for the first time, the IDE starts reporting two errors in the file main.c on lines 308 and 673 -

Symbol 'app_timer_evt_schedule' could not be resolved

and

Symbol 'ble_stack_evt_schedule' could not be resolved

respectively. Both of these are defined as inline functions in headers which are included in the project so I don't understand what is the problem. Plese let me know if you need any more info, any help would be appreciated, thanks.

Parents
  • Importing the paths from the other project helped, thanks! I'm sending the GDB log bellow. I ran the program through breakpoint set at buttons_init() - Nothing happened and the execution didn't stop. After that I pressed the halt button - In the log it's at the point right after Starting target CPU...

    SEGGER J-Link GDB Server V4.73d (beta)
    
    JLinkARM.dll V4.73d (DLL compiled Jul 10 2013 19:00:54)
    
    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link OB-SAM3U128 V1 compiled Feb 5 2013 15:27:51
    Hardware: V1.00
    S/N: XXXXXXXXX
    Checking target voltage...
    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 4 bytes @ address 0x00000000 (Data = 0x20001BD0)
    JTAG speed set to 10000 kHz
    Target endianess set to "little endian"
    Flash download enabled
    Selecting device: NRF51822
    Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Downloading 16160 bytes @ address 0x00014000
    Downloading 16112 bytes @ address 0x00017F20
    Downloading 6436 bytes @ address 0x0001BE10
    Downloading 8 bytes @ address 0x0001D734
    Downloading 1116 bytes @ address 0x0001D73C
    Writing register (PC = 0x0001caf5)
    Read 4 bytes @ address 0x0001CAF4 (Data = 0x68024808)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Setting breakpoint @ address 0x00015066, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    ...Breakpoint reached @ address 0x00015066
    Reading all registers
    Removing breakpoint @ address 0x00015066, Size = 2
    Read 4 bytes @ address 0x00015066 (Data = 0xFAEDF7FF)
    Reading 64 bytes @ address 0x20003FC0
    Starting target CPU...
    Debugger requested to halt target...
    WARNING: CPU could not be halted
    Reading all registers
    ERROR: Can not read register 0 (R0) while CPU is running
    ERROR: Can not read register 1 (R1) while CPU is running
    ERROR: Can not read register 2 (R2) while CPU is running
    ERROR: Can not read register 3 (R3) while CPU is running
    ERROR: Can not read register 4 (R4) while CPU is running
    ERROR: Can not read register 5 (R5) while CPU is running
    ERROR: Can not read register 6 (R6) while CPU is running
    ERROR: Can not read register 7 (R7) while CPU is running
    ERROR: Can not read register 8 (R8) while CPU is running
    ERROR: Can not read register 9 (R9) while CPU is running
    ERROR: Can not read register 10 (R10) while CPU is running
    ERROR: Can not read register 11 (R11) while CPU is running
    ERROR: Can not read register 12 (R12) while CPU is running
    ERROR: Can not read register 13 (R13) while CPU is running
    ERROR: Can not read register 14 (R14) while CPU is running
    ERROR: Can not read register 15 (R15) while CPU is running
    ERROR: Can not read register 16 (XPSR) while CPU is running
    ERROR: Can not read register 17 (MSP) while CPU is running
    ERROR: Can not read register 18 (PSP) while CPU is running
    ERROR: Can not read register 24 (PRIMASK) while CPU is running
    ERROR: Can not read register 25 (BASEPRI) while CPU is running
    ERROR: Can not read register 26 (FAULTMASK) while CPU is running
    ERROR: Can not read register 27 (CONTROL) while CPU is running
    ERROR: Can not read register 15 (R15) while CPU is running
    Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    GDB closed TCP/IP connection
    Closing remote socket
    Waiting for GDB connection...
    
Reply
  • Importing the paths from the other project helped, thanks! I'm sending the GDB log bellow. I ran the program through breakpoint set at buttons_init() - Nothing happened and the execution didn't stop. After that I pressed the halt button - In the log it's at the point right after Starting target CPU...

    SEGGER J-Link GDB Server V4.73d (beta)
    
    JLinkARM.dll V4.73d (DLL compiled Jul 10 2013 19:00:54)
    
    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link OB-SAM3U128 V1 compiled Feb 5 2013 15:27:51
    Hardware: V1.00
    S/N: XXXXXXXXX
    Checking target voltage...
    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 4 bytes @ address 0x00000000 (Data = 0x20001BD0)
    JTAG speed set to 10000 kHz
    Target endianess set to "little endian"
    Flash download enabled
    Selecting device: NRF51822
    Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Downloading 16160 bytes @ address 0x00014000
    Downloading 16112 bytes @ address 0x00017F20
    Downloading 6436 bytes @ address 0x0001BE10
    Downloading 8 bytes @ address 0x0001D734
    Downloading 1116 bytes @ address 0x0001D73C
    Writing register (PC = 0x0001caf5)
    Read 4 bytes @ address 0x0001CAF4 (Data = 0x68024808)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Read 2 bytes @ address 0x00015066 (Data = 0xF7FF)
    Setting breakpoint @ address 0x00015066, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    ...Breakpoint reached @ address 0x00015066
    Reading all registers
    Removing breakpoint @ address 0x00015066, Size = 2
    Read 4 bytes @ address 0x00015066 (Data = 0xFAEDF7FF)
    Reading 64 bytes @ address 0x20003FC0
    Starting target CPU...
    Debugger requested to halt target...
    WARNING: CPU could not be halted
    Reading all registers
    ERROR: Can not read register 0 (R0) while CPU is running
    ERROR: Can not read register 1 (R1) while CPU is running
    ERROR: Can not read register 2 (R2) while CPU is running
    ERROR: Can not read register 3 (R3) while CPU is running
    ERROR: Can not read register 4 (R4) while CPU is running
    ERROR: Can not read register 5 (R5) while CPU is running
    ERROR: Can not read register 6 (R6) while CPU is running
    ERROR: Can not read register 7 (R7) while CPU is running
    ERROR: Can not read register 8 (R8) while CPU is running
    ERROR: Can not read register 9 (R9) while CPU is running
    ERROR: Can not read register 10 (R10) while CPU is running
    ERROR: Can not read register 11 (R11) while CPU is running
    ERROR: Can not read register 12 (R12) while CPU is running
    ERROR: Can not read register 13 (R13) while CPU is running
    ERROR: Can not read register 14 (R14) while CPU is running
    ERROR: Can not read register 15 (R15) while CPU is running
    ERROR: Can not read register 16 (XPSR) while CPU is running
    ERROR: Can not read register 17 (MSP) while CPU is running
    ERROR: Can not read register 18 (PSP) while CPU is running
    ERROR: Can not read register 24 (PRIMASK) while CPU is running
    ERROR: Can not read register 25 (BASEPRI) while CPU is running
    ERROR: Can not read register 26 (FAULTMASK) while CPU is running
    ERROR: Can not read register 27 (CONTROL) while CPU is running
    ERROR: Can not read register 15 (R15) while CPU is running
    Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    GDB closed TCP/IP connection
    Closing remote socket
    Waiting for GDB connection...
    
Children
No Data
Related