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

Running GDB with SES and nRF52840DK

RTT seems to be mostly working using the viewer with the command:

JLinkRTTViewer -device nRF52840_xxAA

It seems I need to re-connect each time I start a debug from SES, but this is okay. What I really need thought is to get gdb communicating during a debug. Starting with the command:

JLinkGDBServer -device nRF52840_xxAA -endian little -if SWD -speed 400kHz

seems to connect but then hangs without a prompt, and I can't run any gdb commands, anything typed in the window has no effect. I running under Ubuntu 18.04

> uname -a
Linux granite10192.168.1.23 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

SEGGER J-Link GDB Server V6.73b (beta) Command Line Version

JLinkARM.dll V6.73b (DLL compiled May 15 2020 17:24:15)

Command line: -device nRF52840_xxAA -endian little -if SWD -speed 400kHz
-----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:      yes
Generate logfile:              off
Verify download:               off
Init regs on start:            off
Silent mode:                   off
Single run mode:               off
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:                 nRF52840_xxAA
Target interface:              SWD
Target interface speed:        400kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
Hardware: V1.00
S/N: 683455871
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
Connected to target
Waiting for GDB connection...

Parents
  • Hi,

    I see that Segger has some information on using Embedded Studio with GDB Server.

    For TWI related questions, please create a separate thread for that. It is definitely a different topic.

    Regards,
    Terje

  • I have looked at SES GDB LINK but it doesn't seem to work. I have set:

    • Debug -> Debugger -> Target Connection to "GDB Server"
    • Debug -> GDB Server -> Type to "J-Link"

    And I have GDB Server Command Line is "$(JLinkDIR)/JLinkGDBServerCL" -device "$(DeviceName)" -silent.

    Information on how to start the gdb client is missing, but with help from Turbo J above, I have in my .gdbinit file:

    file pca10056/blank/ses/Output/Debug/Exe/twi_sensor_pca10056.elf
    target remote localhost:2331

    and I started gdb with

    > arm-none-eabi-gdb
    GNU gdb (7.10-1ubuntu3+9) 7.10
    Copyright (C) 2015 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <gnu.org/.../gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <www.gnu.org/.../>.
    Find the GDB manual and other documentation resources online at:
    <www.gnu.org/.../>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    0x000089c2 in delay_machine_code.7862 ()
    (gdb) b main
    Breakpoint 1 at 0x5964: file /home/martin/Dropbox/Nordic/SDK/Workspace/Peripheral/twi_sensor/main.c, line 274.
    (gdb) c
    Continuing.

    The breakpoint at the beginning of main.c is being ignored.

    A step-by-step tutorial on how to use gdb with SES would be very helpful.

  • Hi,

    You are attaching to an already running target, since your .gdbinit does not include a reset.

    This should give the desired effect:

    b main
    mon reset
    c

    That is, you need to reset the target in order to start executing from the "beginning".

    Regards,
    Terje

Reply Children
No Data
Related