gdb on an STM32U073: Misses breakpoints

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
doctek
Posts: 12
Joined: Mon Oct 12, 2020 11:40 pm

gdb on an STM32U073: Misses breakpoints

Post by doctek »

While using gdb to debug my RTC program on an STM32U073KB micro, I am seeing the following behavior:
- Breakpoints are set at loop and at Configure_RTC. When cont is entered after load, the program breaks at loop, not at Configure_RTC. Entering monitor reset halt, then cont, causes a break at Configure_RTC. This behavior is completely repeatable. Further monitor reset halt and cont sequences result in halts at Configure_RTC. If the program is reloaded and started again, the break will be at loop, until a monitor reset halt and cont.
- A breakpoint set at RTC_TAMP_IRQHandler will never break, although I can prove (by putting in a while(1) {}) that the interrupt happens.

I have used similar gdb techniques with an STM32L071KB part and it works as expected.

Can someone please tell me what might be wrong? I'm at a loss.

I am using Ubuntu 24.04.The (Arduino) code I am running may be seen here: viewtopic.php?t=2497

Thanks!!
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: gdb on an STM32U073: Misses breakpoints

Post by fpiSTM »

With Arduino IDE you have to enable the "optimize for debugging".
Anyway the openocd version included with the stm32 core does not support the U0. So you can't debug it.
doctek
Posts: 12
Joined: Mon Oct 12, 2020 11:40 pm

Re: gdb on an STM32U073: Misses breakpoints

Post by doctek »

Thanks for the reply!
FWIW, optimize for debug was selected.

But the bigger question is who should I be asking about debug support for the U073 series? Surely, if ST wants a new family to be used, they will support debugging, right?

-jim
doctek
Posts: 12
Joined: Mon Oct 12, 2020 11:40 pm

Re: gdb on an STM32U073: Misses breakpoints

Post by doctek »

One more detail: I'm actually using the ST-LINK_gdbserver, not openOCD. Not sure if that matters or not.
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: gdb on an STM32U073: Misses breakpoints

Post by fpiSTM »

doctek wrote: Mon Sep 30, 2024 6:20 pm One more detail: I'm actually using the ST-LINK_gdbserver, not openOCD. Not sure if that matters or not.
OK so we do not talk about debugging STM32U0 thanks the Arduino IDE or you made a customization.

About openOCD STM32U0xx support, a review is ongoing to add it:
https://review.openocd.org/c/openocd/+/8087
doctek
Posts: 12
Joined: Mon Oct 12, 2020 11:40 pm

Re: gdb on an STM32U073: Misses breakpoints

Post by doctek »

The way I debug is to compile code with Arduino, then find the .elf file in /tmp/arduino (check time stamps to find correct file), and use the arm-none-eabi-gdb to debug it. I first start ST-LINK_gdbserver in an Ubuntu command window.

Getting the latest version of the gdbserver seems to get things going properly. Thanks for the tip about doing this.
Post Reply

Return to “IDE's”