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


3. Setup Instructions
3.1. ESP-IDF Visual Studio Code Setup
- Install Visual Studio Code: Download and install Visual Studio Code from https://code.visualstudio.com/Download, selecting the appropriate version for your operating system.
- 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.
- Clone Repository: While the extension is installing, use the git command to clone the repository:
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 clone --recursive https://github.com/Xinyuan-LilyGO/T-Display-P4.gitgit submodule update --init --recursive - 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 - 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.
- 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.

3.2. Firmware Download
- Open Burning Tool: Open the project file "tools" and locate the ESP32 burning tool. Open it.
- 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.
- 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.


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:
| Program | Description | Preview |
|---|---|---|
| uvc_sc2336 (Link) | Original image and screenshot effect of taking a picture on the screen. | ![]() |
| uvc_ov2710 (Link) | Original image and screenshot effect of taking a picture on the screen. | ![]() |
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.
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.
A. Please hold down the "BOOT-0" button and try downloading the program again.
asyncio.exceptions.LimitOverrunError: Separator is found, but chunk is longer than limit
ValueError: Separator is found, but chunk is longer than limitA. 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
| Category | Specification | Category | Specification |
|---|---|---|---|
| Main MCU | ESP32-P4 (Dual-core + AI acceleration) | Co-Processor | ESP32-C6 (WiFi/BLE/Zigbee/Thread) |
| Flash | 16MB | Co-Processor Flash | 4MB |
| Wireless | WiFi 2.4GHz, BLE 5, Zigbee, Thread | LoRa | SX1262 or LR2021 |
| Ethernet | 10/100M PHY | GNSS | L76K + Active Antenna |
| IMU | ICM-20948 (9-axis) | Camera | OV2710 (MIPI) |
| Display Interface | MIPI | Touch | Capacitive, up to 10-point |
| Audio | ES8311 + NS4150B | Microphone | Built-in |
| Speaker | Built-in | Haptic | X-axis linear motor (AW86224) |
| Storage | TF Card (microSD) | RTC | PCF8563 |
| USB | Type-A + Dual Type-C (UART + OTG) | Note | OTG & USB-A cannot be used together |
| Expansion | 2× Qwiic, 2×10 GPIO | Debug | 4-Pin JST 1.0mm |
| IO Expander | XL9535 | Antenna | Internal + IPEX external |
| Battery | 2× 21700 (3.7V) | Capacity | Up to 20000mAh |
| Charging IC | LGS4056H | Battery Gauge | BQ27220 |
| Operating Temp | -20°C ~ 70°C | Storage Temp | -30°C ~ 80°C |
| Dimensions (WxHxD) | 109 x 63 x 22 mm | ||
| Package | Yes | ||
7.2. Display Comparison (AMOLED vs TFT)
| Feature | 4.1" AMOLED | 4.05" TFT (Punch-hole) |
|---|---|---|
| Resolution | 568 × 1232 | 540 × 1168 |
| Display Colors | 16.7M | 16.7M |
| Brightness | 500 cd/m² | 550 cd/m² |
| Contrast Ratio | 20000:1 | 1200:1 |
| Color Gamut | 100% | 70% |
| PPI | 190 | 326 |
| Touch | 10-point capacitive | 10-point capacitive |
| Camera Design | Rear camera | Under-screen (Punch-hole) |
| Best Use Case | Premium display, visual quality | Interactive UI, creative design |

7.3. Pin Diagrams


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:
- GitHub Repository: https://github.com/Xinyuan-LilyGO/T-Display-P4
- GitHub Community: https://github.com/Xinyuan-LilyGo (Post a description of your problem, and engineers will assist you directly.)
LILYGO is an open-source friendly brand, and they encourage sharing and community contributions.

