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

24 REPLIES 24
Krisz72
Associate II

Hi David, thousand thanks for the detailed description!

 

Jimbles
Associate

Hey! Thanks for this, I thought I was going crazy as I had some old proejcts generated using an older version with these tasks added automatically! 

The tasks you suggest are using the command to call the STM32_Programmer_CLI which should have been replaced in v 3.7.0 with the built in CLI tools installed through the bundles manager. Do you have an idea of how to recreate this functionality without installing the STM32CubeProgrammer? 

PRTechTalk
Associate

Hi , i have created a Youtube video on how i solved programming without needing to go via debug.
https://youtu.be/0VvnFkwu2Y0

 

Brgds

PR TechTalk

 

Hey Jimbles.  I updated my post to use the bundled programmer utility so you don't have to install it separately.  The trick was to use "cube programmer" (where "programmer" is the first argument) instead of "STM32_Programmer_CLI".

Jimbles
Associate

Hi David,

 

Thats excellent thanks very much! I just tried that out and it works great. In coincidental timing I was going to add to this thread that I found a solution to at least generate the .bin files automatically, by adding the following to the bottom of the CMakeLists.txt :

# Create .bin from the ELF using the toolchain objcopy
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_OBJCOPY} -O binary
        $<TARGET_FILE:${CMAKE_PROJECT_NAME}>
        ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
    BYPRODUCTS
        ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
    COMMENT "Generating .bin from ELF"
)

I was using this as a backup in case the usb/gdb connection wasnt working so I could at least update the firmware by dragging the .bin file into the external drive NODE_LG476RG. 

Your solution is a great help!