top of page

Set Up Development Environment for ESP32

Updated: Jul 11, 2023

ESP32 is one of Espressif's 32-bit WiFi and Bluetooth SoC (System-on-Chip) series. It is arguably one of the most popular WiFi and Bluetooth chip employed by electronics or embedded system engineers, students, and hobbyists for IoT, smart home, and wireless connectivity projects.


To program and debug an ESP32 chip, you need to have an IDE (Integrated Development Environment) or a code editor and a development framework. An IDE is a software that combines developer tools such as code editor, code compiler, code debugger, and terminal into a compact GUI (Graphical User Interface). In the context of embedded system, a development framework is a set of components that offer basic structure, generic features, reusable libraries, templates, and more to help us create a firmware for a microcontroller or SoC.


Currently, there are 2 development frameworks available: ESP-IDF and Arduino-ESP32. ESP-IDF stands for Espressif IoT Development Framework; it is the official framework from the vendor. Arduino-ESP32 is a framework developed by the community to mimic the structure and style of the popular Arduino programming language (it is actually an Application Programming Interface or API, not a programming language, but let's go with it for now).


The ESP-IDF can be used on 2 IDEs: Eclipse IDE and Visual Studio Code (VSCode). On the other hand, the Arduino-ESP32 can be used on the Arduino IDE and PlatformIO IDE. Note that the PlatformIO IDE is usually installed and used as an extension/plugin of many well-known IDEs, including VSCode. So basically, if you have PlatformIO IDE extension on VSCode, you can also use the Arduino-ESP32 framework on VSCode.


To get started, we recommend VSCode and ESP-IDF.


VSCode Installation (for Windows)

  1. Download VSCode from here.

  2. Double click on the downloaded file to start the installation. (Don't run it as Administrator since it is not recommended to install it system-wide. Doing so will disable VSCode's in-product update flow.)

  3. On the 4th step of VSCode installation, you should check 2 more options as shown below so that after the installation, you can right-click on a code file and have the option to open it with VSCode.

Once you finished installing VSCode, you can proceed to install ESP-IDF.


ESP-IDF Installation

  1. Open VSCode.

  2. Click on View on the menu bar and choose Extension (or click on Extension icon on the left side of the window).

  3. Type espressif idf in the search bar. Then, hit Install on the one released by Espressif Systems which should appear as shown below.

4. Once the installation is complete, press Ctrl+Shift+p and type esp-idf: configure esp-idf extension. Next, select EXPRESS.

5. Choose the latest ESP-IDF version and leave the rest as default. Then, click Install. (It will download about 1 GB of files.)


Once the installation is complete, you should see the following message.


Test ESP-IDF

After the installation is complete, you should do a project compilation test. Follow these steps:

  1. Press Ctrl+Shift+p, type esp-idf: show examples projects , and select it. Then, select Use current ESP-IDF.

  2. Once the ESP-IDF Examples window shows up, select blink under get started group, and click on Create project using example blink.

  3. Next choose where to save your project files. (They will be placed into one folder named after the project name.)

  4. Under main subfolder of the project folder, double click on blink_example_main.c . (VSCode might ask you to install C/C++ Extension Pack if you haven't done so. Just install it.)

5. Click on Build icon at the bottom left of the window. (The first build will take a minute or two.)


If you see a result as shown below in the integrated ESP-IDF terminal, congratulations! You have successfully set up a development environment for ESP32.


コメント


bottom of page