ESP-IDF
This chapter contains the following sections. Please read as needed:
ESP-IDF Getting Started
New to ESP32 ESP-IDF development and looking to get started quickly? We have prepared a general Getting Started Tutorial for you.
- Section 1: Environment Setup
- Section 2: Running Examples
- Section 3: Creating a Project
- Section 4: Using Components
- Section 5: Debugging
- Section 6: FreeRTOS
- Section 7: Peripherals
- Section 8: Wi-Fi Programming
- Section 9: BLE Programming
Please Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before you start, it is recommended that you check the pinout of your development board to ensure the pin configuration is correct.
Setting Up Development Environment
For the ESP32-S3-Touch-LCD-1.83 development board, ESP-IDF V5.3.1 or above is required.
The following guide uses Windows as an example, demonstrating development using VS Code + the ESP-IDF extension. macOS and Linux users should refer to the official documentation.
Install the ESP-IDF Development Environment
-
Download the installation manager from the ESP-IDF Installation Manager page. This is Espressif's latest cross-platform installer. The following steps demonstrate how to use its offline installation feature.
Click the Offline Installer tab on the page, then select Windows as the operating system and choose your desired version from the filter bar.

After confirming your selection, click the download button. The browser will automatically download two files: the ESP-IDF Offline Package (.zst) and the ESP-IDF Installer (.exe).

Please wait for both files to finish downloading.
-
Once the download is complete, double-click to run the ESP-IDF Installer (eim-gui-windows-x64.exe).
The installer will automatically detect if the offline package exists in the same directory. Click Install from archive.

Next, select the installation path. We recommend using the default path. If you need to customize it, ensure the path does not contain Chinese characters or spaces. Click Start installation to proceed.

-
When you see the following screen, the ESP-IDF installation is successful.

-
We recommend installing the drivers as well. Click Finish installation, then select Install driver.

Install Visual Studio Code and the ESP-IDF Extension
-
Download and install Visual Studio Code.
-
During installation, it is recommended to check Add "Open with Code" action to Windows Explorer file context menu to facilitate opening project folders quickly.
-
In VS Code, click the Extensions icon
in the Activity Bar on the side (or use the shortcut Ctrl + Shift + X) to open the Extensions view.
-
Enter ESP-IDF in the search box, locate the ESP-IDF extension, and click Install.

-
For ESP-IDF extension versions ≥ 2.0, the extension will automatically detect and recognize the ESP-IDF environment installed in the previous steps, requiring no manual configuration.
Example
The ESP-IDF examples are located in the ESP-IDF directory of the example package.
| Example | Basic Description |
|---|---|
| 01_AXP2101 | Drive AXP2101 via the ported XPowersLib to obtain power‑related data |
| 02_lvgl_demo_v9 | Run the LVGL V9 demo |
| 03_esp-brookesia | Run the esp-brookesia example (based on the V0.4.2 release version) |
| 04_Immersive_block | Use the QMI8658 for an immersive block that tilts with gravity |
| 05_Spec_Analyzer | Implement a simple audio spectrum analyzer using LVGL |
| 06_videoplayer | Use LVGL to play AVI video from a TF card, with audio playback |
01_AXP2101
Example Description
- This example demonstrates porting XPowersLib in ESP-IDF, and driving AXP2101 to obtain power-related data through the ported XPowersLib
Hardware Connection
- Connect the development board to the computer
Code Analysis
i2c_init: Initializes the I2C master device, preparing it for communication with other devices (e.g., the PMU)- Configures I2C parameters, including setting the master device mode, specifying the SDA and SCL pins, enabling the pull-up resistor, and determining the clock frequency
- Installs the I2C driver to apply the configuration to the actual hardware
pmu_register_read: Reads a series of byte data from a specific register of the PMU- Performs parameter checks to ensure the incoming parameters are valid and avoid invalid read operations
- Performs I2C operations in two steps, first sends the register address to read, then reads the data During the reading process, different processing is carried out according to the length of bytes to be read to ensure accurate reading of the data. At the same time, handles error cases in the I2C communication process and returns the corresponding status code so that the upper-layer code can determine if the read operation is successful
Operation Result
- This example will not light up the screen
- The serial port monitor displays the parameters: chip temperature, charging state, discharging state, standby state, Vbus connection, Vbus condition, charger status, battery voltage, Vbus voltage, system voltage, battery percentage

02_lvgl_demo_v9
Example Description
- This example runs the LVGL V9 demo program
Hardware Connection
- Connect the development board to the computer
Operation Result
03_esp-brookesia
Example Description
- This example demonstrates the UI interface running with the esp-brookesia framework.
Hardware Connection
- Connect the development board to the computer
Operation Result
04_Immersive_block
Example Description
- This example demonstrates the QMI8658 driving effect, implementing multiple blocks that tilt immersively with gravity.
Hardware Connection
- Connect the development board to the computer
Operation Result
05_Spec_Analyzer
Example Description
- This example implements microphone audio capture, uses FFT to analyze the audio, and displays the results on the screen.
Hardware Connection
- Connect the development board to the computer.
Operation Result
06_videoplayer
Example Description
- This example demonstrates playing an AVI video file from a TF card, with audio playback.
Hardware Connection
- Connect the development board to the computer
Operation Result
Customizing the Video Users can customize the audio/video clip by following these steps (some programming experience is required):
- Select the video you want to play (e.g., a.mp4).
- Install the ffmpeg tool.
- Use ffmpeg to convert the video file to AVI format:
ffmpeg -i a.mp4 -vcodec mjpeg -s 'width'x'height' -r 30 -q:v 2 -acodec pcm_s16le -ar 44100 -ac 2 a.avi
- Place the converted AVI file into the
/avi/directory on the TF card. - Insert the TF card into the development board.
- Use ffmpeg to convert the video file to AVI format:
- Compile and flash the program.