I managed to setup CodeBlocks with STLINK and openOCD, but I can't debug the code.
I mean, it runs in debug, but IDE is not following the code.
If anyone wishes to help me with that, I will post some screens with configuration.
Debug the software
- johu
- Site Admin
- Posts: 5769
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1010 times
- Contact:
Re: Debug the software
One thing: you need to compile with “-O0 -g3“
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: Debug the software
Thank you. Still much to learn.
I smell lithium in the air. It's not lithium, it's glycolium.
-
- Posts: 211
- Joined: Mon Jan 18, 2021 12:39 pm
- Location: Edinburgh, Scotland, UK
- Has thanked: 14 times
- Been thanked: 35 times
Re: Debug the software
Is there any chance that debug symbols could be included in the default builds? It confused the heck out of me when I first started working with the code base. I thought it was something complicated to do with the bootloader. Enabling debugging symbols shouldn't cost anything other than a little bit of disk space on the host. I enabled "-ggdb3" on my builds of libopencm3 and stm32_sine as this gives the most information when using gdb which I'd imagine is everyone.
Also, FWIW, "-Og" is the better optimisation setting for debugging than "-O0". It basically optimises within a given source line but doesn't enable optimisation between different source lines. This keeps the code size under control whilst keeping behaviour able to be reasoned about in the debugger.
Also, FWIW, "-Og" is the better optimisation setting for debugging than "-O0". It basically optimises within a given source line but doesn't enable optimisation between different source lines. This keeps the code size under control whilst keeping behaviour able to be reasoned about in the debugger.
- johu
- Site Admin
- Posts: 5769
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 157 times
- Been thanked: 1010 times
- Contact:
Re: Debug the software
-Og is interesting
Makefile could be modified to have debug and release target
Makefile could be modified to have debug and release target
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9