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
  • This helps; it is what I was missing. I must admit I didn't see it anywhere in the manuals. I am using SES and would prefer to run gdb through the IDE, but the degug terminal is completely blank, so I don't know how to run in the IDE (it is also very small, but I assume I can disattach it and then maybe make the font larger?). If you could give some suggestions on how to get the debug window configured to run gdb in the IDE, it would be appreciated. In the meantime, using JLinkGDBServer, I assume if I run it in the directory that contains main.c, I can load the symbol table using something like >file pca10056/blank/ses/Output/Debug/Exe/twi_sensor_pca10056.elf, and I can put both commands in a .gdbinit file in the same directory as main.c? If you have any links suggesting best practices of using gdb with SES, it would be appreciated. Does having gdb running with breakpoints and watches set slow down RTT? If just breakpoints and no watches are set, is RTT slowed down? If neither watches or breakpoints are set, does the program run full speed except for the RTT overhead? Thanks.

    Finally, maybe I should start a new thread for this, but if you have a link for a TWI peripheral example, (not a TWIM) example, it would be appreciated. It seems to me that for initialization, and short data segments, to many different devices, you don't really want a DMA handler, as then you need a mux in the handler to know what device is sending the data? or you need to just wait for completion, with a global wait variable as is done in the twi_sensor project (which should be named twim_sensor?). (Please note these are questions not statements and if I should start new thread for twi vs twim, please let me know.

    Finally, finally, thank you for getting back so quickly, your quick replay has saved a lot of time.

Reply
  • This helps; it is what I was missing. I must admit I didn't see it anywhere in the manuals. I am using SES and would prefer to run gdb through the IDE, but the degug terminal is completely blank, so I don't know how to run in the IDE (it is also very small, but I assume I can disattach it and then maybe make the font larger?). If you could give some suggestions on how to get the debug window configured to run gdb in the IDE, it would be appreciated. In the meantime, using JLinkGDBServer, I assume if I run it in the directory that contains main.c, I can load the symbol table using something like >file pca10056/blank/ses/Output/Debug/Exe/twi_sensor_pca10056.elf, and I can put both commands in a .gdbinit file in the same directory as main.c? If you have any links suggesting best practices of using gdb with SES, it would be appreciated. Does having gdb running with breakpoints and watches set slow down RTT? If just breakpoints and no watches are set, is RTT slowed down? If neither watches or breakpoints are set, does the program run full speed except for the RTT overhead? Thanks.

    Finally, maybe I should start a new thread for this, but if you have a link for a TWI peripheral example, (not a TWIM) example, it would be appreciated. It seems to me that for initialization, and short data segments, to many different devices, you don't really want a DMA handler, as then you need a mux in the handler to know what device is sending the data? or you need to just wait for completion, with a global wait variable as is done in the twi_sensor project (which should be named twim_sensor?). (Please note these are questions not statements and if I should start new thread for twi vs twim, please let me know.

    Finally, finally, thank you for getting back so quickly, your quick replay has saved a lot of time.

Children
No Data
Related