Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
984 stars 238 forks source link

Suspend watchdog counters while halted on a breakpoint #956

Closed marco-polo-github closed 10 months ago

marco-polo-github commented 10 months ago

Hello, because I could not find anything watchdog related I just want to ask here.

Is your feature request related to a problem? Please describe. In my STM32U5 setup the code does stop on a breakpoints while the watchdog is activated, so stopping once is possible but then the watchdog reset appears.

Squinting to the CubeIDE, there is a feature in the menu below "Debug Configurations" which says Device settings -> Suspend watchdog counters while halted -> {No configuration, Enable, Disable} I have just checked the GDB options for that, but it is not related to that.

Would this be a feature for the cortex-debug plugin? If not, do you have a hint where to look at?

haneefdm commented 10 months ago

You have to ask them what they do under the hood to make that work. We can't help you with this if they are setting some registers -- which you can do as well using post one of the pre/post/override settings n launch.json

This is not a gdb feature and I have not seen anything in their gdb-server.

Do these options exist if you select JLink or OpenOCD as a gdb-server?

haneefdm commented 10 months ago

You can also do this in FW. You can query if the debugger is connected and if so, disable the watchdogs.

https://stackoverflow.com/questions/59765691/arm-cortex-m-detect-if-debugger-is-in-run-or-debug-mode

marco-polo-github commented 10 months ago

You have to ask them what they do under the hood to make that work. We can't help you with this if they are setting some registers -- which you can do as well using post one of the pre/post/override settings n launch.json

This is not a gdb feature and I have not seen anything in their gdb-server.

Do these options exist if you select JLink or OpenOCD as a gdb-server?

I guess one has to manipulate the IWDG register to do that. Jlink and OpenOCD do not have such an option: jlink openocd stlink

haneefdm commented 10 months ago

I guess one has to manipulate the IWDG register to do that. Jlink and OpenOCD do not have such an option:

Yes, neither can we. But, it should be easy to do in FW.