Skip to main content
Technical Moderator
March 10, 2023
Question

VSCode for STM32 extension 1.0.0 released

  • March 10, 2023
  • 22 replies
  • 40799 views

VSCode for STM32 extension 1.0.0 is available now

STM32 VS Code Extension

STM32 embedded development support added to Visual Studio Code.

A new STM32 VS Code Extension view container is added to the activity bar which contains lists of functionality that can be activated through a click.

Prerequisites

STM32CubeCLT is a toolset for third-party integrated development environment (IDE) providers, allowing the use of STMicroelectronics proprietary tools within their own IDE frameworks.

It is required for basic build and debug functionality.

For full functionality, three programs need to be installed on your computer:

Features

  • Create VS Code compatible projects from STM32Cube projects
  • Shortcut to create new application projects in STM32CubeMX
  • Cloning of STM32Cube firmware from GitHub
  • Resources containing shortcuts relevant for STM32 development
    • STM32 MCU Developer Zone
    • STM32 firmware on GitHub
    • STMCUFinder
    • ST Community forum
    • Give feedback

Create VS Code compatible projects from STM32Cube projects

This feature makes use of the extension "Embedded Tools" by Microsoft to create a VS Code compatible project from an STM32Cube project.

When clicked, a file selection window is opened up where a cproject file can be selected to import the project.

Shortcut to create new application projects in STM32CubeMX

Opens STM32CubeMX if it is installed on your computer.

When opened up a new application project can be created.

Cloning of STM32Cube firmware from GitHub

Allows selecting firmware for an STM32 device to be downloaded and used in the project or used for source code referencing.

STM32 MCU Developer Zone

A web page dedicated to STM32 developers describing all key ecosystem elements of STM32 and STM32Cube.

STM32 firmware on GitHub

This is where STM32 firmware can be browsed for download or source code referencing.

STMCUFinder

Opens STMCUFinder if it is installed on your computer.

This allows you to browse through the available ST MCUs to find the ones suitable for your projects.

ST Community forum

A place where you can get support from other developers and ST employees, as well as contribute your own knowledge to help others.

Give feedback

This is where you can provide your feedback about this extension that you want us to hear.

Where to get get it

available on the VS Code Extension Marketplace

https://marketplace.visualstudio.com/items?itemName=stmicroelectronics.stm32-vscode-extension

    This topic has been closed for replies.

    22 replies

    Visitor II
    May 5, 2023

    Hi,

    I face the problem gdb cannot run on MacOS Ventura 13.3.1 (a) on M1.

    I got this error message at stating gdb.

    0693W00000bjTIbQAM.jpgIt seems that gdb is not signed.

    I confirmed that it is not signed.

    0693W00000bjTIlQAM.pngHowever, I can run it on terminal as;

    0693W00000bjTJKQA2.pngHow to solve my issue?

    Please give me your idea. Thanks.

    Visitor II
    May 5, 2023

    Hello Nawres GHARBI,

    An extension to compile, debug and flash STM32 projects. This extension is build to work in conjunction with STM32CubeMX and will install the required toolchain when desired. It will automatically startup when it finds a CubeMX file or an STM32 for VSCode configuration file.

    This extension also supports using cpp files, however for this main.c has to be manually renamed to main.cpp for it to work.

    NOTE: Your CubeMX project needs to be generated as a makefile project under project manager->project->Toolchain/IDE

    Prerequisites

    There are a few command line tools that need to be installed for this extension to work. You can either add them manually or let the extension automatically install them for you. This option will be shown on the start-up.

    Configuring CubeMX

    This extension assumes the project initialized with CubeMX and the option to create a Makefile project under Project Manager->Project->Toolchain/IDE. Also please leave the default on Copy all used libraries into the project folder.

    Build process

    The build process uses the information of the CubeMX makefile and the STM32-for-VSCode.config.yaml file to search for dependencies and set flags. The makefile is optional, however the STM32-for-VSCode.config.yaml will always be present when building. After it has gathered all the files and information it will check if the STM32 for VSCode-specific makefile needs to be updated, if so it will update the makefile and run the make/build process.

    Configuration

    The recommended way of configuring the build e.g. adding flags, adding files or directories is by means of the STM32-for-VSCode.config.yaml file. The yaml file contains comments and explanations of each part of the file and should be self-explanatory.

    Thanks,

    Atonal

    Explorer II
    June 8, 2023

    Is there source for this? Cannot get import option to do anything

    Explorer II
    July 21, 2023

    it is not very well. i am waiting for next version. why stm32 does not support a TEST platform? (ready to use and does not need to lots of configurations)

    Visitor II
    October 4, 2023

    Hi,

    This text describes the installations required for the VScode extension. I have followed these instructions and installed all of these softwares, but unfortunately I am not able to compile a STM32 project.

    I have generated the project from the IOC file.

    Is there a writeup or tutorial on required configurations,  how to open, build and debug this project from the VScode.

    Any information regarding this will be very helpful.

    Thanks a lot!!

    Explorer
    October 22, 2023

    Hi,

    How can I import my own .c/.h file (or drivrs/lib by others) in the project ? The "st-project.make" file suggests

    # THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
    I also tried adding a path in CubeIDE then import the edited project in vscode but in vain (the project can be build and upload normally in CubeIDE).

    Thanks

    Visitor II
    November 16, 2023

    Getting the following error in WSL2

    "Cannot activate the 'STM32 VS Code Extension' extension because it depends on the 'Embedded Tools' extension, which is not loaded. Would you like to reload the window to load the extension?"

    Where as the said extension "Embedded Tools" is installed.

    Graduate
    November 23, 2023

    Hi All,

    How do I set up STM32 VS Code Extension to support more that one debug session. With the STM32CubeIDE there is an option in the debugging tab that allows scanning of STM32 serial number and associate this with a debug session.

    I have 3 boards that I need to have running in the debugger and at the moment I find that I have to keep going back to STM32CubeIDE in order to successfully debug.

    Regards

    Ola

    Graduate II
    November 23, 2023

    it's a good start point to new era.

    Graduate
    November 23, 2023

    I can debug successfully with STM32CubeIDE as indicated in my first post. The reason I am trying to use VS Code is out of preference. I also believe that the source code navigation facility is more intuitive compared to Eclipse based IDE.

    And lastly I use VS code for other embedded projects and it think it would be good if I can use the same IDE without not losing any functionality for ditching STM32CubeIDE.