Arduino Setup
This tutorial walks through setting up Arduino IDE for ESP32-P4 development. By the end, you will have the IDE installed with the correct board package and all libraries needed for display demos.
Install Arduino IDE
Section titled “Install Arduino IDE”-
Download Arduino IDE from arduino.cc/en/software. Version 2.x is recommended.
-
Run the installer for your platform.
-
Launch Arduino IDE and let it complete its initial setup.
Install the ESP32 board package
Section titled “Install the ESP32 board package”The ESP32-P4 requires board package version 3.2.0 or later from Espressif.
-
In Arduino IDE, go to File > Preferences (or Arduino IDE > Preferences on macOS).
-
In the Additional Boards Manager URLs field, add:
https://espressif.github.io/arduino-esp32/package_esp32_index.jsonIf other URLs are already present, separate them with commas.
-
Click OK to save.
-
Open Tools > Board > Boards Manager.
-
Search for “esp32” and find “esp32 by Espressif Systems”.
-
Select version 3.2.0 (or the latest available >= 3.2.0) and click Install.
-
Wait for the download and installation to complete.
For more details, see Waveshare’s Arduino board manager tutorial.
If your network blocks the Espressif server or the download is unreliable:
-
Download the offline board package from the Waveshare demo package (included on the product wiki page).
-
Extract the archive to your Arduino hardware directory:
- Windows:
C:\Users\<you>\AppData\Local\Arduino15\packages\ - Linux:
~/.arduino15/packages/ - macOS:
~/Library/Arduino15/packages/
- Windows:
-
Restart Arduino IDE. The ESP32-P4 should appear under Tools > Board.
Install required libraries
Section titled “Install required libraries”Several libraries are needed for display and GUI demos. The table below lists each one with its required version and install method.
| Library | Version | Install method | Purpose |
|---|---|---|---|
| GFX_Library_for_Arduino | v1.6.0 | Offline | GFX graphical library for display rendering |
| lvgl | v9.3.0 | Offline recommended | LVGL graphical framework for HMI interfaces |
| displays | latest | Offline | I2C driver, screen definitions, touch driver |
| lv_conf.h | — | Manual copy | LVGL configuration header |
Offline library installation
Section titled “Offline library installation”-
Download the demo package from the Waveshare ESP32-P4-WIFI6-DEV-KIT wiki. The relevant library files are inside the archive.
-
Locate your Arduino libraries folder:
- Windows:
C:\Users\<you>\Documents\Arduino\libraries\ - Linux:
~/Arduino/libraries/ - macOS:
~/Documents/Arduino/libraries/
- Windows:
-
Copy each library folder into the libraries directory:
GFX_Library_for_Arduino/lvgl/displays/
-
Copy
lv_conf.hinto the Arduino libraries root folder (the same level as the library folders, not inside any single library). -
Restart Arduino IDE.
-
Verify the libraries appear under Sketch > Include Library. You should see all three listed.
For additional guidance on managing Arduino libraries, see Waveshare’s library manager tutorial.
Verify the installation
Section titled “Verify the installation”-
Go to Tools > Board and select ESP32P4 Dev Module (under the “esp32” section).
-
Go to File > Examples and confirm that examples from
GFX_Library_for_Arduinoandlvglare listed. -
Open a simple example sketch (such as the HelloWorld from the demo package).
-
Click Verify (checkmark icon) to compile. The build should complete without errors.
What to do next
Section titled “What to do next”Your Arduino environment is ready. Proceed to First Flash to connect the board and upload your first sketch.