Skip to content

The First Lesson: Installation and Configuration of IDF-IDE and Printing "Hello World" via Serial Port

1. Download Visual Studio Code


Open the official website link:

https://code.visualstudio.com

Click to download.

6

Accept the license agreement and go next.

img

Accept the default location or click 'Browse...' to change the installation location.

8

Accept the resting default option and click 'Next >'...

Click install and waiting for the installation ...

9

Click 'Finish' to exit the installation and (by default) launch Visual Studio Code

10

2. Install the extension


Open Visual Studio Code and open Extension Manager

11

Click on the [Extensions] extension icon.

Select the C/C++ extension plugin and click [Install].

img

Search for keywords such as espressif, esp-idf, esp32, esp32s2, etc. in the Extensions.

Click [Install] for the esp-idf extension.

img

After the installation is complete, we enter ESP-IDF, select "Configure ESP-IDF Extension", and get ready to download the version of ESP-IDF for use.

image-20260513101046152

After entering, select [EXPRESS].

img

Note: Select version v5.1.1.

Follow the instructions in the red box in the picture step by step to make your choices.

In the following interface,click [Install] to start the installation.

img

Then, just wait patiently for the installation to be completed.

img

When you see this interface, it means the installation has been completed correctly.

img

In this way, we have successfully installed the ESP-IDF version V5.1.1 required for the subsequent code compilation.

3. Create a new IDF project.


click ”New project”.

img

Fill in the project name, select the save location and the chip model.

Click "Choose Template".

img

Select an official Espressif example and choose the “hello_world” template.

img

Click”Create project using template hello_world”

img

Generate the newly created IDF project.

  1. The build folder is the build directory, used to store files generated during the compilation process.

  2. CMakeLists.txt is the CMake build file for the main application.

  3. hello_world_main.c is the source file of the main application.

  4. CMakeLists.txt is the top - level CMake build file, used to configure the entire project.

  5. sdkconfig is the project configuration file, which saves the configuration of idf.py menuconfig.

The significance of the header files included in the main program:

  1. stdio.h: The function of stdio.h is basically the same as its function in a standard C program. However, there are some specific considerations and extensions, especially in the embedded development environment related to the ESP32 series of chips.

  2. The function of the inttypes.h header file is similar to its function in standard C programming. It is mainly used to provide a series of macros, which can help developers write code that is independent of the size of integer types.

  3. The sdkconfig.h file is a very important configuration header file. It is generated by the project's configuration system, based on the choices made by the user during the project configuration process.

  4. The esp_chip_info.h header file provides some macro definitions and functions, which are used to obtain detailed information about the ESP chip, such as the chip model, functional features, and hardware configuration.

  5. The esp_flash.h header file provides functions and macro definitions related to the flash memory operations on the ESP chip.

  6. esp_system.h is a header file in the ESP-IDF (Espressif IoT Development Framework). It contains functions and macro definitions related to the system-level functions of Espressif chips such as ESP32, ESP32-S, and ESP8266.

  7. freertos/freertos.h is a general header file that includes the core functions of FreeRTOS.

  8. freertos/task.h is a header file specifically used for task management.

img

Select the corresponding serial port.

img

Select the chip type.

img

img

Configure the development board options.

img

Set the flash parameters.

img

Set the PSRAM parameters.

img

Click [Save].

img

Click to compile the project.

img

Wait for the compilation to complete.

img

Click "Flash".

img

Open the serial port and view the printed information.

img

img