Debugging with eclipse/sloeber
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Debugging with eclipse/sloeber
Has anyone recently got eclipse/sloeber running with openOCD/gdb?
I followed the instructions on github (https://github.com/stm32duino/wiki/wiki/How-to-debug) but I always get an error message saying
no source available for "function()" at "address"
as well as "No symbol table is loaded. Use the "file" command." in the debugger console
Is this because I installed the debugging packages ontop of an existing eclipse/sloeber? (installed as complete package conveniently offered by sloeber devs?
any help appreciated...
I followed the instructions on github (https://github.com/stm32duino/wiki/wiki/How-to-debug) but I always get an error message saying
no source available for "function()" at "address"
as well as "No symbol table is loaded. Use the "file" command." in the debugger console
Is this because I installed the debugging packages ontop of an existing eclipse/sloeber? (installed as complete package conveniently offered by sloeber devs?
any help appreciated...
Re: Debugging with eclipse/sloeber
you would need st-link v2
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
you have got that?
most Nucleo boards has it built on board
on Windows I think you'd also need stm32cubeprogrammer
https://www.st.com/en/development-tools ... eprog.html
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
you have got that?
most Nucleo boards has it built on board
on Windows I think you'd also need stm32cubeprogrammer
https://www.st.com/en/development-tools ... eprog.html
Last edited by ag123 on Fri Aug 19, 2022 10:27 am, edited 3 times in total.
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: Debugging with eclipse/sloeber
yes, I use Nucleo-L4R5
sorry for ommiting that crucial detail
sorry for ommiting that crucial detail
Re: Debugging with eclipse/sloeber
there are quite a few things there, i don't use sloeber so can't really comment.
the build needs to have -g debug and -Og optimisation
you'd need to pay attention to the Setting up GDB part
https://github.com/stm32duino/wiki/wiki ... ing-up-gdb
and not least, you need to build your sketch with the core in eclipse (sloeber)
oh and openocd
https://github.com/stm32duino/wiki/wiki ... up-openocd
google turns up some docs, hope it helps
https://www.st.com/resource/en/user_man ... ronics.pdf
^ note stm32cube IDE may have its own gdb server that does the same thing as openocd.
you may want to check if it is after all installed together with stm32cube programmer
https://www.st.com/resource/en/applicat ... ronics.pdf
the build needs to have -g debug and -Og optimisation
you'd need to pay attention to the Setting up GDB part
https://github.com/stm32duino/wiki/wiki ... ing-up-gdb
and not least, you need to build your sketch with the core in eclipse (sloeber)
oh and openocd
https://github.com/stm32duino/wiki/wiki ... up-openocd
google turns up some docs, hope it helps
https://www.st.com/resource/en/user_man ... ronics.pdf
^ note stm32cube IDE may have its own gdb server that does the same thing as openocd.
you may want to check if it is after all installed together with stm32cube programmer
https://www.st.com/resource/en/applicat ... ronics.pdf
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: Debugging with eclipse/sloeber
-Og is available and active but I don't know where to check och enable the -g flag
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: Debugging with eclipse/sloeber
some parts seem to be working correctly, in the console window I get output from openOCD that looks fairly like it successfully connected toe the STLink/µC
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: Debugging with eclipse/sloeber
and thanks for the links!
the github smt32duino, I knew already. That is the instructions I followed - with one little difference: I had eclipse/sloeber package already installed
the github smt32duino, I knew already. That is the instructions I followed - with one little difference: I had eclipse/sloeber package already installed
-
- Posts: 51
- Joined: Thu Nov 05, 2020 10:26 am
Re: Debugging with eclipse/sloeber
I found it - must have had tomatoes on my eyes...
It is readily available in the sloeber project config menu
shame on me!
but alas, the problem remains :/
It is readily available in the sloeber project config menu
shame on me!
but alas, the problem remains :/
Re: Debugging with eclipse/sloeber
unfortunately, I do not use sloeber, only eclipse CDT with a makefile, and in Linux.
generally, I think you need to build your sketch in eclipse and install it on your device, e.g. using st-link etc.
This is in part as eclipse keeps a structure for its projects on where to find the files.
the bin file install can even be done externally, but that the build/compile needs to be done in eclipse, so that eclipse would save its compiled object files, symbol tables somewhere (mostly in the .elf file and possible the 'map' file) that it can find and show the traces.
then the next thing is to setup a debug configuration.
https://github.com/stm32duino/wiki/wiki ... ing-up-gdb
this part is mainly to connect to the gdb server.
- the gdb server can either be open ocd.
or like mentioned prior
- stm32 cube ide has a gdb server that can connect to stm32 cube programmer. I'm wondering if it could have been installed if you simply install stm32cube programmer
oh check things like this out, in case they work 'easier'/'better'
https://www.gdbgui.com/
generally, I think you need to build your sketch in eclipse and install it on your device, e.g. using st-link etc.
This is in part as eclipse keeps a structure for its projects on where to find the files.
the bin file install can even be done externally, but that the build/compile needs to be done in eclipse, so that eclipse would save its compiled object files, symbol tables somewhere (mostly in the .elf file and possible the 'map' file) that it can find and show the traces.
then the next thing is to setup a debug configuration.
https://github.com/stm32duino/wiki/wiki ... ing-up-gdb
this part is mainly to connect to the gdb server.
- the gdb server can either be open ocd.
or like mentioned prior
- stm32 cube ide has a gdb server that can connect to stm32 cube programmer. I'm wondering if it could have been installed if you simply install stm32cube programmer
oh check things like this out, in case they work 'easier'/'better'
https://www.gdbgui.com/
Re: Debugging with eclipse/sloeber
I made it work some time ago. The debugging with Sloeber.
For compile options add in boards.txt for your board
BluePill128kswd.build.flags.optimize=-g -Og
BluePill128kswd.compiler.c.extra_flags=-DDEBUG
BluePill128kswd.compiler.cpp.extra_flags=-DDEBUG
BluePill128kswd.compiler.elf2hex.extra_flags=--debugging
follow these instructions to create a "Debug configuration" in Eclipse
https://github.com/jantje/hardware/blob ... md/read.me
For compile options add in boards.txt for your board
BluePill128kswd.build.flags.optimize=-g -Og
BluePill128kswd.compiler.c.extra_flags=-DDEBUG
BluePill128kswd.compiler.cpp.extra_flags=-DDEBUG
BluePill128kswd.compiler.elf2hex.extra_flags=--debugging
follow these instructions to create a "Debug configuration" in Eclipse
https://github.com/jantje/hardware/blob ... md/read.me