news

New Features of the ESP-IDF VS Code Extension

Shanghai, China
Feb 28, 2022

Learn what’s new in the ESP-IDF Visual Studio Code extension!

The ESP-IDF extension of Visual Studio Code aims at helping developers write code based on ESP-IDF and Espressif chips. We constantly try to improve the extension’s usability by adding features that enhance user experience. Below you can find the latest features we have added.

ESP-IDF QEMU Integration

QEMU is an open-source machine emulator commonly used to emulate operating systems and many hardware devices. Espressif has a QEMU fork with ESP32 as a possible target which can be used to emulate -in software- the behavior of a real ESP32 device.

We added this QEMU fork in a Dockerfile with the project template file .devcontainer. You can find more information on this feature by clicking here.

Partition Table Editor

Developers should now be able to get partition table information on connected devices, and be allowed to select any .bin file to flash to a given partition.

Importing an Existing ESP-IDF Project

We added the Import ESP-IDF Project command to the ESP-IDF VS Code extension. The above-mentioned command will copy an existing ESP-IDF project and add a .vscode configuration and .devcontainer files to a new project that can then be saved in a given location under a certain project name.

Integrated ESP-IDF Component Registry

The IDF Component registry is integrated into the extension and this allows users to add a component to their project. Run the ESP-IDF: Show Component registry command to launch the component page.

Welcome Page

We added a new welcome page with documentation links and buttons for basic features of the extension. You can simply run the ESP-IDF: Welcome command to launch it.

Other Notable Improvements and Features

  • You can now use gdb commands directly for Heap tracing. Previously, we were using openOCD TCL commands to start and stop heap tracing, but now we are using gdb commands with a gdb file instead. To learn more about heap tracing, please review the ESP-IDF documentation and the tutorial about the heap-tracing extension.
  • We also added the idf-size.py output after a build task. This is done after executing the ESP-IDF: Build your project command or the ESP-IDF: Build, flash and start a monitor command. Either of these commands will help users understand the amount of memory used in their applications, and reduce the binary size.
  • We have now added a JTAG flashing type to the Build, flash and monitor command. Prior to this, the command was only using UART flashing, but from now on it will use the flash type defined in the idf.flashType configuration setting.
  • We also added the Configure project for coverage command to set the required values in your project’s sdkconfig file, which will enable code coverage for your project. This is necessary if you want to enable the code coverage feature in the extension, as shown in the code coverage tutorial.
  • We have now enabled using portable git and python in the extension’s setup workflow for Windows users, who -from now on- do not need to install any prerequisites when configuring the extension with the ESP-IDF: Configure ESP-IDF extension setup wizard.
  • Developers can now enable or disable the CMakeLists.txt SRCS field update, whenever creating or deleting .c files. Use the idf.enableUpdateSrcsToCMakeListsFile configuration setting to enable and disable it.
  • Use the Espressif download mirrors for the extension setup wizard. From now on, if downloading from Github is slow in your location, you can choose the download server in the ESP-IDF: Configure ESP-IDF extension setup wizard.
  • We added a serial port and IDF target to the VSCode status bar, while also enabling the change of commands with a single click.
  • From now on, users are allowed to configure pre-build, post-build, pre-flash, post flash, and custom tasks with added configuration settings, and with a status bar icon for the custom task, in particular. You can use the idf.preBuildTask to define a task before the build task, the idf.postBuildTask after the build task, the idf.preFlashTask before the flash task and the idf.postFlashTask after the flash task. There is also an idf.customTask which can be used with the ESP-IDF: Execute custom task (which has a status bar icon).
  • Now you should be able to control the settings for enabling/disabling notifications of completed extension commands, and reveal the task output when it is hidden. Setting the idf.notificationSilentMode configuration to “true” will hide any VSCode notifications from this extension, such as Build Successful and flash done, and will show the task output directly.

By clicking on the following link you can get all the details about the new features of the ESP-IDF extension of Visual Studio Code. Needless to say, the extension is far from complete. We are continuously improving existing features, while also adding new ones, so keep an eye on this space!

Related links

Share this article
  • LinkedIn
  • 微信

    微信分享

    打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
Reuse this content

Ioannis

Technical Writer and Editor

About this author ›