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

debugging under linux [solved]

Hi All,

I can compile and flash examples with my nrf51822 SDK on linux. I would like to use Code::Blocks as IDE. Code::Blocks is transparent to run debugger. I try to use it with the following configuration:

  1. start JLinkGDBServer: konsole -e "JLinkGDBServer -device nrf51822 -if swd -speed 1000 -device nrf51822 -if swd -speed 1000 -port 2331"

It starts and works well.

  1. I try to start gdb under codeblocks: Starting debugger: /usr/bin/arm-none-eabi-gdb -nx -fullname -quiet -args /home/zamek/bluetooth/work/radiotransmit/build/radiotransmit

additional commands before connected:

target remote localhost:2331

monitor interface SWD

monitor endian little

monitor reset 0

monitor flash device=nrf51822

monitor speed 1000

load ./build/nrf51422_xxac.out

monitor reset

in the status window I see the following message:

Connecting to remote target

Setting breakpoints

Debugger name and version: GNU gdb (7.7.1+dfsg-1+6) 7.7.1

Connected

The program is not being run.

Debugger finished with status 0

What is the correct gdb parameters for debugging?

thx a lot Zamek

Parents
  • Hi All,

    I can found it. Process is the following:

    1. start JLinkGDBServer: JLinkGDBServer -device nrf51822 -i swd -speed 1000
    2. Start Code::Blocks
    3. Global settings/debugger/default executable path: /usr/bin/arm-none-eabi-gdb
    4. project/properties/debugger:
    project connection type: TCP
    ipaddress: localhost Port:2331
    **uncheck** connect with extended-remote
    **check** Do NOT adjust LD_LIBRARY_PATH before launching debugger
    
    additional gdb commands:
    
    before connection:
    target remote localhost:2331
    monitor speed 1000
    monitor endian little
    monitor flash breakpoints=1
    monitor flash download=1
    monitor flash device=swd
    file ./build/<elf_file>
    load
    
    after connection:
    thbreak main
    monitor reset
    continue
    

    delete thbreak main if you don't want to break in main

    thx Zamek

Reply
  • Hi All,

    I can found it. Process is the following:

    1. start JLinkGDBServer: JLinkGDBServer -device nrf51822 -i swd -speed 1000
    2. Start Code::Blocks
    3. Global settings/debugger/default executable path: /usr/bin/arm-none-eabi-gdb
    4. project/properties/debugger:
    project connection type: TCP
    ipaddress: localhost Port:2331
    **uncheck** connect with extended-remote
    **check** Do NOT adjust LD_LIBRARY_PATH before launching debugger
    
    additional gdb commands:
    
    before connection:
    target remote localhost:2331
    monitor speed 1000
    monitor endian little
    monitor flash breakpoints=1
    monitor flash download=1
    monitor flash device=swd
    file ./build/<elf_file>
    load
    
    after connection:
    thbreak main
    monitor reset
    continue
    

    delete thbreak main if you don't want to break in main

    thx Zamek

Children
No Data
Related