How to reset target MCU during debugging Posted by samuel.zhang@rheem.com on 2015-07-28 03:15 Sometimes I want reset the MCU during debugging, but SW4STM32 canit reset MCU, I must stop the debugging and download again. How to reset the MCU? Sam
Posted by tang on 2015-07-28 10:15 Hi Sam, Unfortunalty, there is no button yet to reset the MCU. This is on the todo list. For now, as you say, you can terminate then launch the debug session again. This is also what the "Terminate and Relaunch" action (in the contextual menu) is doing. Kevin
Posted by joe on 2015-11-03 06:28 Hi Kevin, I'm Joe, ST MCU FAE in sydney. At first, I'd like to thank for your great support. SW4STM32 is a really great free tools for STM32 fans. Lots of customers are keen on "reset button" function which can save debugging time. currently we can use "monitor reset halt" command to reset MCU, but as you know, it's not convenient. As you mentioned above, "reset button" is on the todo list. May I knwow the timeframe? When will we get the exciting new version with reset button? Thanks again. Joe
Posted by joe on 2015-11-03 06:33 Hi Kevin, I'm Joe, ST MCU FAE in sydney. At first, I'd like to thank for your great support. SW4STM32 is a really great free tools for STM32 fans. Lots of customers are keen on "reset button" function which can save debugging time. currently we can use "monitor reset halt" command to reset MCU, but as you know, it's not convenient. As you mentioned above, "reset button" is on the todo list. May I knwow the timeframe? When will we get the exciting new version with reset button? Thanks again. Joe
Posted by MSchultz on 2015-09-08 18:32 It is possible to do a reset without having to reload your application, although there are some issues you will have to deal with if you use the approach I describe below. To perform a target reset, first halt your application, then select the Console window (typically located at the bottom of the Eclipse UI), then enter this command in the Console window: monitor reset halt This will reset the target and stop the application at the very first instruction, which is usually the pre-main() C startup assembly code. Note that the source level debugger display will NOT update automatically after issuing the reset command. However, if you hit one of the single-step buttons (e.g. F6, Step Over) the source debug display will update. You will then probably want to switch the debug display to your main() and either highlight the first code line of main() and hit Ctrl-R (Run To Line) or set a breakpoint on it and hit F8 (Resume). From this point you should be able to debug your application normally. I am not certain if "monitor reset halt" does a full hardware MCU reset, or just restarts the application at the reset vector without fully resetting the MCU.
Posted by samuel.zhang@rheem.com on 2015-09-16 05:39 the "monitor reset halt" command seem does't work. I pause the program, put a breakpoing at the first line of main() function., type "monitor reset halt" in the Console Window, press F8(resume), the program does't trigger the breakpoint. Regards Sam
Posted by mkerr@atspl.com.au on 2016-10-31 22:33 To get debugging to work for me, I need to do the following: Step 1: Click the debug button. This starts thread #1, but it never stops on the main() breakpoint. Step 2: Suspend (pause) debugging. Step 3: Execute "monitor reset halt" in the console. Step 4: Resume debugging. Thread #1 now halts at the main() breakpoint. I haven't read anyone else needing to do this. This threads seems to be specific to resetting the target while already debugging. Can anyone suggest why I might be seeing what I'm seeing? Thanks.
Posted by dautrevaux on 2015-09-16 08:23 Maybe the breakpoint was temporarily suppressed as you just hit it... Try to step further in your program before trying to reset it. Bernard
Posted by samuel.zhang@rheem.com on 2015-09-16 09:14 I do this way: Step1: press "Suspend": button to pause my program. Step2: Go to "Console Window", type "monitor reset halt". Step3: Press "F5" (Single step ). This debugger "High light" goes to the next step of my program, it doesn't execute "reset". It will be great if I can reset it, it is annoying that everytime I have to reload the program so many times during debugging. Regards Sam
Posted by samuel.zhang@rheem.com on 2015-10-29 01:53 It works now after I set the debug configuration to "Ac6 STM32 Debugging". Previously, I set the debug configuration to "GDB Hardware Debugging". Regards Sam
Posted by diabolo38 on 2015-10-29 12:33 On many ST eval or nucleo board put a break point in main , press go tolet mcu run reset the cpu via the push button .. voila your back to the breakpoint after reset
Posted by kaosad on 2016-05-15 06:01 I also find this a great pain. It has been on the todo list close to a year now. Maybe you would like to try out CoIDE. It has Mcu reset button. Also, you can disable the programming of the binary image to the mcu on the initiation of debugger and programming it at will with a single click of button later.
Posted by mibcat on 2017-01-31 20:09 Any news after this long time ? Version: 1.12.0.201701121612 still not providing a reset button ...
Posted by hugo_habicht on 2017-07-09 11:09 One of the most essential functions of an embedded debugger still missing.....
Posted by MSchultz on 2017-07-12 02:28 The v2.x branch of SW4STM32 -does- provide a reset button, although it's not immediately obvious. It's a new button just to the left of the double-X clear-terminated-tasks button that is part of the task list dialog (the upper left hand window in the debug view). With the v1 branch of SW4STM32, I was able to make the "monitor reset halt" trick mentioned by others in this thread work some of the time - it would seem to work correctly if I did a 'manual' break (clicking the pause-icon button when the app was running in real time), but was much more hit-or-miss if I tried to do it after stopping due to a breakpoint. It definitely DOES NOT work at all if your app is in the normal run state. It seems as the input console interface to GDB (which is where the 'monitor reset halt' directive is getting sent to) does not function at all in SW4STM32 v2.x. Fortunately, the new 'reset button' works pretty reliably.
Posted by droberson on 2020-01-30 23:44 Sorry for bringing up an old thread but this functionality seems to still be missing from the latest stable version (Windows 64 bit installer Version v2.9, updated on Friday, April 12, 2019 at 16:41:04 CEST). The "Reset the chip and restart debug session" button is grayed out during a debug session, even when stepping through code or sitting at a breakpoint. I am debugging a dual-core STM32H745. For comparison, in STM32CubeIDE, this reset button works as intended. I am new to SW4STM32, coming from Keil uVision. What am I missing? Thanks!