cancel
Showing results for 
Search instead for 
Did you mean: 

Run without debugging on VSCode

DamianoF
Associate III

I have setup STM32 VSCode extension on my PC and it is amazing. The only problem that I have encountered is that it is not possible to run the code without debugging. I removed the "runToEntryPoint": "main" line in launch.json. But every time I launch the code it attaches a debugger. How can I simply run the code without debugging?

 

Thank you,

Damiano

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

In the tasks.json file, there is a a "task" labeled STM32: CubeProg: Flash project (SWD) 

You can execute this task to perform a "flash and reset" altogether! 

There are 3 options to execute this: 

Option1: By "clicking": Terminal > Run Task... > CubeProg: Flash Project (SWD)
SarraS_0-1746551491069.png

Option2 via Run Task keyboard shortcut:

Option3: Pre-installed keyboard shortcut:

  • CTRL + P
  • Type: "Task CubePro..." <-- You will notice that the menu auto-suggests tasks matching your pattern.

Option3: Pre-installed keyboard shortcut: 

  • CTRL+ALT+F <-- This will immediately execute the same task

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.

View solution in original post

7 REPLIES 7
Sarra.S
ST Employee

Hello @DamianoF

Did you try this and didn't not work for you? 

SarraS_1-1745485979741.png

 

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.

Hello @Sarra.S and thank you for your answer

 

I tried it and it kind of works, but not in the way I expected. When I click "Run Without Debugging" as you suggested, the debug buttons (those in the image below) still appear and the code does not execute until I click on the red square (which is the stop button, a little counterintuitive). What I expect is that when I click on "Run without debugging" the code will be flashed directly on the MCU, the debug buttons don't show up and the code does not wait for me to click any button at all.

 

DamianoF_0-1745495311641.png

 

TDK
Guru

STM32CubeIDE had this issue for the first few releases. It's odd that the developers didn't realize "run without debugging" was a critical feature. Maybe it's the same devs.

If you feel a post has answered your question, please click "Accept as Solution".
DamianoF
Associate III

@TDKI am not using STM32CubeIDE, but VSCode with STM32 VSCode extension

Hello @DamianoF

For the moment, in order to execute this from the VS Code top menu, 

  1. Stop the current MCU from running using Shift + F5 (if it is running)
  2. After compiling and flashing with "Run Without Debugging, manually reset the device on the hardware in order to start executing. 

Please check Mattias's answer in this thread: New STM32 VSCode extension V2.0.0 released - STMicroelectronics Community

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.

Thank you @Sarra.S!

So at the moment the only solution is to do what I already do. If possible I ask to you if you can report this limitation to the ST team that develops the extension. It is not a big limitation but it is very helpful in day-to-day use

Sarra.S
ST Employee

In the tasks.json file, there is a a "task" labeled STM32: CubeProg: Flash project (SWD) 

You can execute this task to perform a "flash and reset" altogether! 

There are 3 options to execute this: 

Option1: By "clicking": Terminal > Run Task... > CubeProg: Flash Project (SWD)
SarraS_0-1746551491069.png

Option2 via Run Task keyboard shortcut:

Option3: Pre-installed keyboard shortcut:

  • CTRL + P
  • Type: "Task CubePro..." <-- You will notice that the menu auto-suggests tasks matching your pattern.

Option3: Pre-installed keyboard shortcut: 

  • CTRL+ALT+F <-- This will immediately execute the same task

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.