LILYGO T-Display-P4

Contents

LILYGO® T-Display-P4 User Manual

ESP32-P4 ESP32-C6 LoRa Dev Board with AMOLED/TFT Touch Screen

1. Introduction

The LILYGO® T-Display P4 is a next-generation high-performance smart display development platform built on the latest ESP32-P4 flagship chip, designed for AIoT, edge computing, and advanced human-machine interaction. It combines powerful processing, rich connectivity, high-resolution displays, and extensive expansion capabilities, making it one of the most feature-complete ESP32-P4 development boards available.

The T-Display-P4 is a versatile development board based on the ESP32-P4 core. Its features include:

  • High Processing Power: Equipped with the high-performance ESP32-P4 core processor, it can handle more complex graphics and video tasks, delivering smoother display performance.
  • Low Power Design: Offers multiple selectable power modes to effectively reduce energy consumption and extend battery life.
  • High-Resolution Display: Supports high resolution (default with a large MIPI interface screen at 540x1168px), providing sharp and clear visuals.
  • Rich Peripheral Support: Onboard peripherals include an HD MIPI touchscreen, ESP32-C6 module, speaker, microphone, LoRa module, GPS module, Ethernet, a linear vibration motor, an independent battery gauge for monitoring battery health and percentage, and an MIPI camera. Multiple GPIOs of both the ESP32-P4 and ESP32-C6 are exposed, enhancing the device's expandability.

2. Package Contents

The LILYGO T-Display-P4 package typically includes the following items:

  • 1 x LILYGO T-Display P4 Development Board (either 4.1 inch AMOLED or 4.05 inch TFT version)
  • 1 x Antenna
LILYGO T-Display P4 AMOLED version and antenna
Package contents for the 4.1 inch AMOLED version: 1x T-Display P4, 1x Antenna.
LILYGO T-Display P4 TFT version and antenna
Package contents for the 4.05 inch TFT version: 1x T-Display P4, 1x Antenna.

3. Setup Instructions

3.1. ESP-IDF Visual Studio Code Setup

  1. Install Visual Studio Code: Download and install Visual Studio Code from https://code.visualstudio.com/Download, selecting the appropriate version for your operating system.
  2. Install ESP-IDF Extension: Open the Extensions sidebar in Visual Studio Code (or press Ctrl+Shift+X), search for ESP-IDF, and install the extension.
  3. Clone Repository: While the extension is installing, use the git command to clone the repository:
    git clone --recursive https://github.com/Xinyuan-LilyGO/T-Display-P4.git
    Ensure you include the --recursive flag during cloning. If you forget to include it, you will need to initialize the submodules later by running:
    git submodule update --init --recursive
  4. Install and Configure ESP-IDF: Download and install ESP-IDF v5.4.1 from https://dl.espressif.cn/dl/esp-idf/?idf=4.4. Take note of the installation path. Open the previously installed "ESP-IDF" extension and select "Configure ESP-IDF Extension." Choose the "USE EXISTING SETUP" menu, then select "Search ESP-IDF in system." Correctly configure the installation path you noted earlier:
    IDF_PATH : xxx\Espressif\frameworks\esp-idf-v5.4
    IDF_TOOLS_PATH : xxx\Espressif
  5. Configure SDK: Click the "SDK Configuration Editor" in the ESP-IDF extension menu at the bottom of Visual Studio Code. In the search bar, look for the field "Select the example to build" and choose the project you want to compile. Then, search for "Select the camera type" and select the camera model integrated on your board. Save the settings.
  6. Build and Flash Project: Click "Set Espressif Device Target" in the bottom menu bar of Visual Studio Code and select ESP32P4. Next, click "Build Project" in the bottom menu bar and wait for the build to complete. Then, click "Select Port to Use," followed by "Flash Project" to upload the program.
ESP32P4 target selection in Visual Studio Code
Selecting ESP32-P4 as the target chip in Visual Studio Code.

3.2. Firmware Download

  1. Open Burning Tool: Open the project file "tools" and locate the ESP32 burning tool. Open it.
  2. Configure and Burn: Select the correct burning chip and burning method, then click "OK." Follow steps 1->2->3->4->5 as shown in the picture to burn the program. If the burning is not successful, press and hold the "BOOT-0" button and then download and burn again.
  3. Select Firmware File: Burn the file located in the root directory of the project file "firmware" (https://github.com/Xinyuan-LilyGO/T-Display-P4/blob/main/firmware). There is a description of the firmware file version inside; choose the appropriate version to download.
ESP32 burning tool chip type, work mode, and load mode selection
Selecting ChipType, WorkMode, and LoadMode in the burning tool.
SPI Download tool interface with steps for firmware flashing
Steps for flashing firmware using the SPI Download tool.

4. Operating Instructions

Once the firmware is successfully loaded, the T-Display-P4 will boot up and display its interface. Interact with the device using its capacitive touch screen. Specific functionalities will depend on the loaded firmware and custom applications.

4.1. Camera Examples

The T-Display-P4 supports camera functionalities. Below are examples demonstrating camera usage:

ProgramDescriptionPreview
uvc_sc2336 (Link)Original image and screenshot effect of taking a picture on the screen.
Preview of uvc_sc2336 camera example
Camera preview for uvc_sc2336.
uvc_ov2710 (Link)Original image and screenshot effect of taking a picture on the screen.
Preview of uvc_ov2710 camera example
Camera preview for uvc_ov2710.

5. Maintenance

To ensure the longevity and optimal performance of your LILYGO T-Display-P4, follow these general maintenance guidelines:

  • Keep the device clean and free from dust and debris. Use a soft, dry cloth for cleaning.
  • Avoid exposing the device to extreme temperatures, humidity, or direct sunlight.
  • Handle the device with care to prevent physical damage to the screen or internal components.
  • Ensure proper ventilation when operating for extended periods, especially during development or heavy processing tasks.

6. Troubleshooting

This section addresses common issues you might encounter with your LILYGO T-Display-P4.

Q. After reading the above tutorials, I still don't know how to build a programming environment. What should I do?

A. If you still don't understand how to build an environment after reading the above tutorials, you can refer to the LilyGo-Document instructions to build it.
Q. Why is my board continuously failing to download the program?

A. Please hold down the "BOOT-0" button and try downloading the program again.
Q. Why do I encounter configuration failures with the following errors when selecting the target compilation chip or configuring menuconfig in the ESP-IDF framework?
asyncio.exceptions.LimitOverrunError: Separator is found, but chunk is longer than limit
ValueError: Separator is found, but chunk is longer than limit

A. This is a bug in ESP-IDF framework versions v5.4 to v5.5. Modify line 351 in the file located at esp-idf-v5.x\tools\idf_py_actions\tools.py as follows:
Original code:
p = await asyncio.create_subprocess_exec(*cmd, env=env_copy, limit=1024 * 256, cwd=self.cwd, stdout=asyncio.subprocess.PIPE,stderr=asyncio.subprocess.PIPE)
Modified code:
p = await asyncio.create_subprocess_exec(*cmd, env=env_copy, limit=1024 * 512, cwd=self.cwd, stdout=asyncio.subprocess.PIPE,stderr=asyncio.subprocess.PIPE)

7. Specifications

7.1. General Specifications

CategorySpecificationCategorySpecification
Main MCUESP32-P4 (Dual-core + AI acceleration)Co-ProcessorESP32-C6 (WiFi/BLE/Zigbee/Thread)
Flash16MBCo-Processor Flash4MB
WirelessWiFi 2.4GHz, BLE 5, Zigbee, ThreadLoRaSX1262 or LR2021
Ethernet10/100M PHYGNSSL76K + Active Antenna
IMUICM-20948 (9-axis)CameraOV2710 (MIPI)
Display InterfaceMIPITouchCapacitive, up to 10-point
AudioES8311 + NS4150BMicrophoneBuilt-in
SpeakerBuilt-inHapticX-axis linear motor (AW86224)
StorageTF Card (microSD)RTCPCF8563
USBType-A + Dual Type-C (UART + OTG)NoteOTG & USB-A cannot be used together
Expansion2× Qwiic, 2×10 GPIODebug4-Pin JST 1.0mm
IO ExpanderXL9535AntennaInternal + IPEX external
Battery2× 21700 (3.7V)CapacityUp to 20000mAh
Charging ICLGS4056HBattery GaugeBQ27220
Operating Temp-20°C ~ 70°CStorage Temp-30°C ~ 80°C
Dimensions (WxHxD)109 x 63 x 22 mm
PackageYes

7.2. Display Comparison (AMOLED vs TFT)

Feature4.1" AMOLED4.05" TFT (Punch-hole)
Resolution568 × 1232540 × 1168
Display Colors16.7M16.7M
Brightness500 cd/m²550 cd/m²
Contrast Ratio20000:11200:1
Color Gamut100%70%
PPI190326
Touch10-point capacitive10-point capacitive
Camera DesignRear cameraUnder-screen (Punch-hole)
Best Use CasePremium display, visual qualityInteractive UI, creative design
Comparison table of AMOLED vs TFT display features
Detailed comparison of AMOLED and TFT display features.

7.3. Pin Diagrams

LilyGo T-Display-P4 TFT Pinmap showing MCU, LORA, GPS, Ethernet, Camera, Speaker, Microphone, IMU, RTC, IO Expansion, and USB connections
LilyGo T-Display-P4 TFT Pinmap.
LilyGo T-Display-P4 AMOLED Pinmap showing MCU, LORA, GPS, Ethernet, Camera, Speaker, Microphone, IMU, RTC, IO Expansion, and USB connections
LilyGo T-Display-P4 AMOLED Pinmap.

8. User Tips

  • LoRa Radio Performance: The integrated LoRa radio may exhibit weaker performance compared to some other dedicated LoRa devices. For applications requiring robust long-range communication, consider optimizing antenna placement or using external LoRa modules if possible.
  • On-Screen Keyboard Usability: The on-screen keyboard, particularly buttons located on the side, can be challenging to accurately press. For tasks requiring precise input or extensive typing, consider connecting an external input device or developing a custom UI with larger, more accessible buttons.
  • LoRa Frequency Confirmation: If your application requires a specific LoRa frequency (e.g., US915), ensure that the purchased model supports it. Check the product specifications or contact support if unsure.

9. Warranty and Support

For technical support, sample code, and detailed information regarding the LILYGO T-Display-P4, please refer to the official GitHub repository and community:

LILYGO is an open-source friendly brand, and they encourage sharing and community contributions.

Ask a question about this manual

Ask about setup, troubleshooting, compatibility, parts, safety, or missing instructions. Manuals+ will review the question and use this page’s manual context to help answer it.

After a successful submission, we securely hash the supplied account or form email before sending it to Microsoft Advertising for conversion attribution. Privacy details.