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!!
gdb on an STM32U073: Misses breakpoints
Re: gdb on an STM32U073: Misses breakpoints
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.
Anyway the openocd version included with the stm32 core does not support the U0. So you can't debug it.
Re: gdb on an STM32U073: Misses breakpoints
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
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
Re: gdb on an STM32U073: Misses breakpoints
One more detail: I'm actually using the ST-LINK_gdbserver, not openOCD. Not sure if that matters or not.
Re: gdb on an STM32U073: Misses breakpoints
OK so we do not talk about debugging STM32U0 thanks the Arduino IDE or you made a customization.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.
About openOCD STM32U0xx support, a review is ongoing to add it:
https://review.openocd.org/c/openocd/+/8087
Re: gdb on an STM32U073: Misses breakpoints
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.
Getting the latest version of the gdbserver seems to get things going properly. Thanks for the tip about doing this.