cancel
Showing results for 
Search instead for 
Did you mean: 

VSCode for STM32 extension 1.0.0 released

Nawres GHARBI
ST Employee

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

32 REPLIES 32
atonalwilson
Associate

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

bibble235
Associate III

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

nima.askari
Associate II

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)

Thanks!! It's worked for me.

stm32_user
Associate

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!!

allannick
Associate II

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

sivaram
Associate III

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.

ola
Associate III

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

Tinnagit
Senior II

it's a good start point to new era.

You can select “Cube IDE” option directly if you stick to Cube toolchain, or select “makefiles” option if you are going to use general GCC toochain for firmware compile.