cancel
Showing results for 
Search instead for 
Did you mean: 

Add reset MCU command to debug toolbar

AHugh.2
Associate III

Hi,

Is it possible to add a MCU reset command to the debug toolbar? I.e. a button that does a pause then "monitor reset" type sequence? Of course I can do this manually in the debug console, but it'd be nice to have a button to do it, to complement the full restart button.

Thanks!

14 REPLIES 14
Nawres GHARBI
ST Employee

available now 

Thank you very much for this!

AHugh.2
Associate III

Hi,

One observation, say I want it just to reset and not break on main, then I have put this in the lauch.json:

"quickReset": [
   "monitor reset",
   "continue"
]

So just ommitted the "tbreak main" line, but I find doing this allows only one reset then no other debug commands seem to work - can't pause, and pressing the quick reset button again results in it the button becoming disabled and that's it.

With tbreak in, no problems.

Thanks.

 

The error comes from a desynchronization between the GDB client and the VSCode debug session.
During the reset, the GDB client correctly sends the "continue" command after the reset.
However, VSCode does not synchronize, so any new command from VSCode is not handled by the GDB client.

In the meantime, to avoid this behavior with quickReset: [monitor reset; continue], you must at least set a manual breakpoint in the code so that the GDB client hits it and synchronizes with VSCode.

Note:

  • setting the breakpoint manually, rather than in the quickReset command, allows you to change the breakpoint before a reset.
  • if you are hung, setting the breakpoint after the reset will not work because the GDB client is running and will not respond.

 

BR,
Flo

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for the response Florent.

In my case I was looking for a quick MCU reset and run to catch something with minimal "down-time". However it is not a big deal.