Skip to content

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.

  1. Download Arduino IDE from arduino.cc/en/software. Version 2.x is recommended.

  2. Run the installer for your platform.

  3. Launch Arduino IDE and let it complete its initial setup.

The ESP32-P4 requires board package version 3.2.0 or later from Espressif.

  1. In Arduino IDE, go to File > Preferences (or Arduino IDE > Preferences on macOS).

  2. In the Additional Boards Manager URLs field, add:

    https://espressif.github.io/arduino-esp32/package_esp32_index.json

    If other URLs are already present, separate them with commas.

  3. Click OK to save.

  4. Open Tools > Board > Boards Manager.

  5. Search for “esp32” and find “esp32 by Espressif Systems”.

  6. Select version 3.2.0 (or the latest available >= 3.2.0) and click Install.

  7. Wait for the download and installation to complete.

For more details, see Waveshare’s Arduino board manager tutorial.

Several libraries are needed for display and GUI demos. The table below lists each one with its required version and install method.

LibraryVersionInstall methodPurpose
GFX_Library_for_Arduinov1.6.0OfflineGFX graphical library for display rendering
lvglv9.3.0Offline recommendedLVGL graphical framework for HMI interfaces
displayslatestOfflineI2C driver, screen definitions, touch driver
lv_conf.hManual copyLVGL configuration header
  1. Download the demo package from the Waveshare ESP32-P4-WIFI6-DEV-KIT wiki. The relevant library files are inside the archive.

  2. Locate your Arduino libraries folder:

    • Windows: C:\Users\<you>\Documents\Arduino\libraries\
    • Linux: ~/Arduino/libraries/
    • macOS: ~/Documents/Arduino/libraries/
  3. Copy each library folder into the libraries directory:

    • GFX_Library_for_Arduino/
    • lvgl/
    • displays/
  4. Copy lv_conf.h into the Arduino libraries root folder (the same level as the library folders, not inside any single library).

  5. Restart Arduino IDE.

  6. 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.

  1. Go to Tools > Board and select ESP32P4 Dev Module (under the “esp32” section).

  2. Go to File > Examples and confirm that examples from GFX_Library_for_Arduino and lvgl are listed.

  3. Open a simple example sketch (such as the HelloWorld from the demo package).

  4. Click Verify (checkmark icon) to compile. The build should complete without errors.

Your Arduino environment is ready. Proceed to First Flash to connect the board and upload your first sketch.