Cannot debug with J-Link & Segger & Embedded GDB Server

Answered

I'm trying to debug an nRF52832 chip, but it is not really going as planned. In the Embedded GDB server, I have filled in all settngs:

 

 

My custom target looks like this:

add_custom_target(UPLOAD arm-none-eabi-gdb
-iex "mon speed 10000"
-iex "mon flash download=1"
-iex "load"
-iex "break main"
-iex "mon reset 0"
-iex "continue"
)

The Segger GDBServerCL starts very nicely, except I get the following error:

I have followed this https://www.jetbrains.com/help/clion/embedded-gdb-server.html link and my cmake lists looks like this https://github.com/elmot/clion-embedded-arm/blob/master/resources/xyz/elmot/clion/cubemx/tmpl_CMakeLists.txt

Target interface speed set to 2000 kHz
Flash download enabled
Cannot configure GDB defaults: cannot change this setting while the inferior is running

Error during pretty printers setup: Undefined info command: "pretty-printer". Try "help info".

Some features and performance optimizations will not be available.

com.intellij.execution.ExecutionException: Cannot determine architecture of the target: elf32-littlearm
Remote doesn't know how to detach

Debugger disconnected

Process finished with exit code 0
GDB Server stopped, exit code -1073741510

 

 

4 comments
Comment actions Permalink

For anyone wondering. I started a new project and started from scratch again. It is working now as intended. my custom target now looks like this:

 

add_custom_target(UPLOAD
arm-none-eabi-gdb
-iex "target remote localhost:2331"
-iex "mon program \"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.elf"
-iex "mon speed 10000"
-iex "load \"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.out\""
-iex "file \"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.out\""
-iex "break main"
-iex "mon reset"
-iex "continue"
)
0
Comment actions Permalink

Hi Marc,

Good to know you've managed to run your nRF project, and thanks for letting us know how it's done. Probably we will document that somehow.
We have a couple of notes about your setup:
- "monitor speed" probably does not make sense, the speed is already set via command line, and the programming is already done at that point.
- You may try writing your "program" command, without "monitor" into a script file, and then pass the file name to JLinkGdbServer via `-jlinkscriptfile` CLI parameter. For more details, check`UM08001_JLink.pdf` document, shipped with jlink software.
- You are using gdb without python installed, and that disables pretty printers feature and produces that message. To have them enabled, you may switch to our bundled gdb or install python (2.7, bitness depends on your gdb distribution, most probably 32 bit) and use `arm-none-eabi-gdb-py.exe` executable as the debugger.

0
Comment actions Permalink

Hi Anna,

 

I have absolutely no experience with GDB, I'm still a student whose at the moment doing an internship. Thanks for your feedback. I have added your feedback to my project and it works.

After some research, it appeared that JLinkGDBServer already uses a script file (https://devzone.nordicsemi.com/f/nordic-q-a/8532/jlink-script-for-nrf52). So specifying this, is ambigious. Also, the JlinkScript file appears to be a C like language.

0
Comment actions Permalink

Thanks for your research anyway.

0

Please sign in to leave a comment.