Skip to content

uPesy only delivers currently in France.

Contents Menu Expand Light mode Dark mode Auto light/dark mode

Using VS Code & PlatformIO to build complex projects on the ESP32

This article explains how to install the Visual Studio Code software with the PlatformIO plugin to be able to program more than 400 development boards within the same software, such as Arduino, ESP32, Nucleo, and STM32, Teensy, and Raspberry Pi. In our case, we can program the ESP32 boards with the Arduino language or with the native ESP-IDF framework.

Boards and libraries are installed automatically by the software.

Visual Studio Code is available on all platforms (Windows / macOS / Linux).

Installation of VS Code

To install Visual Studio Code on Windows, follow the steps below:

  • Download the latest version of the software on the Arduino website by clicking on “Download for Windows (Stable Build).”

  • Run the .exe installation file; then, after accepting the terms of the license agreement, you can choose the installation folder :

    installation VS code choisir dossier

    Laissez le dossier d’installation par défaut

  • In the window on additional tasks, check at least the following boxes:

    options lors de l’installation de VS code

    Cocher au minimum les cases suivantes

  • The installation is now complete, the VS Code welcome page is as follows:

    apercu du logiciel vscode lors du premier lancement

    Apercu du logiciel VS Code lors du 1er démarrage

  • VS Code is in English by default. To put it in French, you have to download an extension “French Language Pack” available in the plugins manager (last icon in the left menu).

    Mettre vs code en français

    Mettre VS Code en français

Note

Even if VS Code can be put in French, PlatformIO remains in English .

  • Then VS Code must restart to change the language

    redemarrer VS Code pour l’avoir en français

    Visual Studio Code est maintenant en français après redémarrage

Note

To change the language, click on Cogwheel > Command palette and type language in the command palette, then click on Change the display language .

accéder à la palette de commandes dans vs code

Accéder à la palette de commandes

switcher la langue d’affichage dans vscode

Switcher la langue d’affichage

VS Code can be completely customized; among other things, you can change the theme.

Now that the text editor has been installed, PlatformIO must be installed to be able to program the ESP32 boards.

PlatformIO

Installation on VS Code

  • The installation of the PlatformIO plugin is done directly in VS Code from the plugin manager. Just type in the search bar PlatformIO and then click on Install .

    installer l’extension platformio ide dans vscode

    Installer PlatformIO dans VS Code

  • If the installation was successful, a window appears inviting you to reload VS Code:

    redémarrage requis après l’installation de platformio

    Redémarrage requis pour finaliser l’installation

  • A new icon has been added to the left menu. We arrive on the home page of PlatformIO :

nouvel onglet ajouté dans vs code

Apercu de PlatformIO dans VS Code

The installation of PlatformIO is complete.

Configuring PlatformIO for ESP32

Until now, no platform (Arduino / ESP-IDF / STM32Cube) has been installed. All the necessary tools will be downloaded and installed when creating a project on the chosen board.

To be able to program an ESP32 like on the Arduino IDE software (using the Arduino language) :

  • Create a new project by clicking on Projects > Create New Project

    comment creer un nouveau projet avec platformio dans vs code

    Créer un nouveau projet PlatformIO

  • Then give a name to your project, and select an ESP32 board, for example, the Espressive ESP32 Dev module . You can then choose between the Framework Arduino or ESP-IDF . Select Arduino to program the ESP32 in the same way as on the Arduino IDE.

    configuration d’un projet platformio

    Chosir la bonne carte ESP32

  • Click on src > main.cpp in the drop-down menu on the left to start programming like on the Arduino IDE.

    apercu d’un code arduino depuis platformIO

    Code Arduino avec PlatformIO

  • To be able to use the PSRAM of the uPesy Wrover Devkit board, you must add in the configuration file platformio.ini

build_flags =
 -DBOARD_HAS_PSRAM
 -mfix-esp32-psram-cache-issue
fichier de configuration de platformIO: platformio.ini

Apercu du fichier de configuration de PlatformIO

We use cookies to make your visit to the site as pleasant as possible. Privacy Policy