Working with ESP-IDF
This chapter includes 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 the Development Environment
For the ESP32-S3-LCD-1.69 development board, ESP-IDF version 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.
The screenshots in this section use ESP-IDF V5.5.2 as an example. When installing, please select the ESP-IDF version that matches your board's example.
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 the ESP-IDF version you need (the version shown in the screenshot is for reference only — choose the version that fits your actual needs).

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
ESP32-S3-LCD-1.69 Example Programs
| Example | Basic Description |
|---|---|
| 01_ESP_IDF_ST7789 | Drive the st7789 screen via SPI to display text, images, graphics, and more |
| 02_ESP_IDF_ST7789_LVGL | Demonstrate LVGL example, use LVGL to display image data |
| 03_PCF85063 | Drive the pcf85063 in a simple way for time storage and retrieval |
| 04_QMI8658 | Port SensorLib using ESP-IDF, and use the ported SensorLib to drive the qmi8658 to obtain gyroscope-related data |
01_ESP_IDF_ST7789
Hardware Connection
- Connect the board to the computer using a USB cable.
Code Analysis
ST7789():
Initializes various font objects, ready for displaying text on the screen;
Initializes the TFT_t object related to the ST7789 display, including setting SPI pins and display parameters through the spi_master_init and lcdInit functions;
Enters an infinite loop, calling various graphics test functions (such as FillTest, ColorBarTest, etc.) and font display test functions in sequence, to show different graphics effects and font display effects on the display. There is a period of time between each test to observe the results.
Expected Behavior
- Drives the st7789 screen via SPI to display text, images, graphics, and more
![]() | ![]() | ![]() | ![]() |
|---|
02_ESP_IDF_ST7789_LVGL
Hardware Connection
- Connect the board to the computer using a USB cable.
Code Analysis
app_lcd_init():
Configures and initializes the LCD backlight pin;
Initializes the SPI bus for communication with the LCD;
Creates the LCD panel I/O object and configures SPI-related parameters;
Installs the LCD driver, creates the LCD panel object, and performs initialization operations such as reset, enabling display, setting mirroring, etc.;
Turns on the LCD backlight.
Initializes LVGL and configures parameters such as task priority, stack size, and timer period;
Configures the parameters of the LCD display and add it to the LVGL as a display device. In this way, LVGL can draw a graphical interface on this display.
Expected Behavior
- LVGL displays image data
![]() | ![]() | ![]() | ![]() |
|---|
03_PCF85063
Hardware Connection
- Connect the board to the computer using a USB cable.
Code Analysis
rtc_get_time():
This function reads the current time from the RTC (real-time clock chip, here it is assumed to be PCF85063). It reads 7 bytes of data starting from a specific register address by calling the rtc_read_reg function, representing seconds, minutes, hours, day, day of the week, month, and year.
It converts the read BCD-format data to decimal format and prints the current time. If the read fails, an error message is printed and an error code is returned.
rtc_set_time():
This function sets the time of the RTC. It accepts hours, minutes, seconds, day, month, and year as parameters, converts these decimal values to BCD format, and assembles them into an array.
It sets the time of the RTC by calling the rtc_write_reg function to write this array to the beginning of the specific register address of the RTC. If the write succeeds, ESP_OK is returned; otherwise, the corresponding error code is returned.
Expected Behavior
- Drives the pcf85063 for time storage and retrieval

04_QMI8658
Hardware Connection
- Connect the board to the computer using a USB cable.
Code Analysis
read_sensor_data():
Uses the qmi.getAccelerometer function to read the accelerometer data, and if the reading is successful, print the data for the three axes of the accelerometer. If it fails, prints an error message.
Uses the qmi.getGyroscope function to read the gyroscope data, and if the read is successful, print the data for the three axes of the gyroscope. If it fails, prints an error message.
Uses the qmi.getTimestamp and qmi.getTemperature_C functions to obtain the sensor timestamp and temperature respectively, and print them;
If no data is ready, print a warning message. Then waits for a short period before checking again for data readiness.
Expected Behavior
- Obtains gyroscope-related data








