LILYGO T-Display-P4

Version History:
| Version | Update date | Update description |
|---|---|---|
| T-Display-P4_V1.0 | 2025-06-13 | Initial version |
| T-Display-P4-Keyboard_V1.0 | 2025-09-12 | Keyboard expansion board initial version |
Purchase Links
| Product | SOC | FLASH | PSRAM | Link |
|---|---|---|---|---|
| T-Display-P4_V1.0 | ESP32-P4 | 16MB | - | LILYGO Mall |
| T-Display-P4-Keyboard_V1.0 | - | - | - | LILYGO Mall |
Table of Contents
Description
T-Display-P4 is a multi‑functional development board based on the ESP32‑P4 high‑performance core, designed for complex graphics processing, multimedia interaction, and IoT applications. Main features include:
- High‑Performance Processing: Equipped with ESP32‑P4 processor, supports complex graphics and video tasks.
- HD Display: Features a 4.05‑inch MIPI interface screen with a resolution of 540×1168px, supporting touch.
- Dual‑Core Collaboration: Onboard ESP32‑C6 auxiliary processor, supports Wi‑Fi 6 and Bluetooth 5.3.
- Rich Peripherals: Integrates speaker, microphone, linear vibration motor, LoRa, GPS, Ethernet, camera, battery monitoring, and other modules.
- High Expandability: Provides abundant GPIO interfaces, supports keyboard expansion board (T-Display-P4-Keyboard).
Preview
Physical Image

Pin Diagrams
T-Display-P4 has two versions: Amoled and TFT. Pin diagrams are as follows:
Amoled Version

TFT Version

Modules
T-Display-P4 Main Board
Core Processor
- Chip: ESP32-P4
- FLASH: 16MB
- Documentation: Espressif Official Documentation
Auxiliary Processor
- Module: ESP32-C6-MINI-1U
- Chip: ESP32-C6-FH4
- PSRAM: 4MB
- Communication Protocol: SDIO
- Documentation: ESP32-C6-MINI-1U Datasheet
Display and Touch
| Model | H0405S002T002-V0 (TFT) | H0410S001AMT001-V0 (AMOLED) |
|---|---|---|
| Size | 4.05 inch | 4.1 inch |
| Type | α-Si TFT | AMOLED |
| Resolution | 540×1168px | 568×1232px |
| Interface | MIPI + I2C | MIPI + I2C |
| Driver Chip | HI8561 | RM69A10 + GT9895 |
| Brightness | 550 cd/m² | 500 cd/m² |
| Contrast | 1200:1 | 20000:1 |
| Touch Points | 10 points | 10 points |
| Documentation | HI8561 | RM69A10 GT9895 |
Audio Module
- DAC Chip: ES8311
- Amplifier Chip: NS4150B
- Microphone: Mic head
- Communication Protocol: I2S
- Documentation: ES8311 、NS4150B
Vibration Motor
- Driver Chip: AW86224AFCR
- Communication Protocol: I2C
- Documentation: AW86224
LoRa Module
- Module: HPD16A
- Chip: SX1262
- Communication Protocol: SPI
- Documentation: SX1261-2
GPS Module
- Module: L76K
- Communication Protocol: UART
- Documentation: L76K
RTC Clock
- Chip: PCF8563
- Communication Protocol: I2C
- Documentation: PCF8563
Charging Management
- Chip: LGS4056H
- Description: Supports three‑wire battery NTC temperature detection
- Documentation: LGS4056H
Battery Monitoring
- Chip: BQ27220
- Communication Protocol: I2C
- Documentation: BQ27220
Camera
- Model: OV2710 (MIPI interface)
- Documentation: OV2710
Inertial Sensor
- Chip: ICM20948
- Communication Protocol: I2C
- Documentation: ICM20948
IO Expansion
- Chip: XL9535
- Communication Protocol: I2C
- Documentation: XL9535
T-Display-P4-Keyboard Expansion Board
Keyboard Driver
- Chip: TCA8418
- Communication Protocol: I2C
- Documentation: TCA8418
Backlight Driver
- Chip: SY7200A
- Communication Protocol: PWM
- Documentation: SY7200A
IO Expansion
- Chip: XL9555
- Communication Protocol: I2C
- Documentation: XL9555
Wireless Module (T-MixRF)
| Module | Chip | Protocol | Documentation |
|---|---|---|---|
| CC1101 | CC1101 | SPI | CC1101 |
| NRF24L01 | NRF24L01 | SPI | NRF24L01 |
| NFC | ST25R3916 | SPI | ST25R3916 |
Overview
| Component | Description |
|---|---|
| MCU | ESP32-S3R8 Dual-core LX7 microprocessor |
| FLASH | 16MB |
| PSRAM | 8MB |
| Display | 1.91 inch RM67162 IPS AMOLED |
| Touch | Capacitive Touch Screen |
| LoRa | LR1121 (1276/868/915MHz) |
| Storage | TF Card |
| RTC | PCF85063ATL/1 |
| Power Management | AXPM65611 + BQ25896 |
| Wireless | 2.4 GHz Wi-Fi & Bluetooth 5 (LE) |
| USB | 1 × USB Port and OTG (TYPE-C) |
| IO Interface | 2×13 Dual-row Expansion Interface |
| Expansion Interface | FPC Antenna + TF Card + STEMMA QT/QWIIC + JST-GH 1.25MM |
| Buttons | 1 x RESET Button + 1 x BOOT Button |
| Mounting Holes | 4 × 2mm Positioning Holes |
| Dimensions | 60×32×12mm |
Quick Start
Example Support
T-Display-P4 Examples
| example | [vscode][esp-idf-v5.4.0] |
description | picture |
|---|---|---|---|
| afe | |||
| aw86224 | |||
| bq27220 | |||
| deep_sleep | |||
| es8311 | |||
| es8311_sd_wav | |||
| esp_hosted_mcu_sdio_wifi | |||
| esp32c6_at_host_sdio_uart | |||
| esp32c6_at_host_sdio_wifi | |||
| icm20948 | |||
| iic_scan | |||
| l76k | |||
| lvgl_9_ui | Factory Example | ||
| pcf8563 | |||
| radiolib_sx1262_send_receive | |||
| screen_camera | |||
| screen_lvgl | |||
| screen_lvgl_touch_draw | |||
| sgm38121 | |||
| sx1262_gfsk_send_receive | |||
| sx1262_lora_send_receive | |||
| sx1262_tx_continuous_wave | |||
| tusb_serial_device | |||
| xl9535 | |||
| xiaozhi |
T-Display-P4-Keyboard Examples
| example | [vscode][esp-idf-v5.4.0] |
description | picture |
|---|---|---|---|
| radiolib_cc1101_send_receive | |||
| radiolib_nrf24l01_send_receive | |||
| screen_tca8418_lvgl_touch_draw | |||
| st25r3916 | |||
| tca8418 | |||
| xl9555 |
ESP-IDF Visual Studio Code
Install Visual Studio Code, choose the installation according to your system type.
Open the "Extensions" in the sidebar of Visual Studio Code (or use Ctrl+Shift+X to open extensions), search for the "ESP-IDF" extension and install it.
While the extension is installing, use the git command to clone the repository:
git clone --recursive https://github.com/Xinyuan-LilyGO/T-Display-P4.gitYou need to add "--recursive" when cloning. If not added during cloning, you need to initialize the submodules later:
git submodule update --init --recursiveDownload and install ESP-IDF v5.4.1, record the installation path, open the previously installed "ESP-IDF" extension and open "Configure ESP-IDF Extension", select the "USE EXISTING SETUP" menu, select the "Search ESP-IDF in system" field, correctly configure the previously recorded installation path:
- ESP-IDF directory (IDF_PATH):
Your installation path xxx\Espressif\frameworks\esp-idf-v5.4 - ESP-IDF Tools directory (IDF_TOOLS_PATH):
Your installation path xxx\Espressif
Click the "install" button in the bottom right corner to install the framework.
- ESP-IDF directory (IDF_PATH):
Click the ESP-IDF extension menu "SDK Configuration Editor" in the bottom menu bar of Visual Studio Code, search for the "Select the example to build" field in the search bar, select the project you need to compile, then search for the "Select the camera type" field, select the camera type onboard your board, and click Save.
Click "Set Espressif device target" in the bottom menu bar of Visual Studio Code, select ESP32P4, click "Build Project" in the bottom menu bar, wait for the build to complete, then click "Select port to use" in the bottom menu bar, then click "Flash Project" to flash the program.
Firmware Downloads
| firmware | description | picture |
|---|---|---|
| t_display_p4_lvgl_9_ui | Factory Program | |
| t_display_p4_keyboard_lvgl_9_ui | Keyboard Expansion Board Factory Program | |
| esp32c6_at | esp32c6-at Factory Program | |
| esp32c6_slave_esp_hosted_mcu_network_adapter | ||
| t_display_p4_xiaozhi |
Pin Overview
For pin definitions, please refer to the configuration files:
t_display_p4_config.h
t_display_p4_keyboard_config.h
Development Platforms
Related Tests
Power Consumption
| firmware | program | description | picture |
|---|---|---|---|
| deep_sleep(single_board) | deep_sleep | Average current consumption: 1.2mA. For more information, see Power Consumption Test Log |
Camera
| program | description | picture |
|---|---|---|
| uvc_sc2336 | Original image and captured screen image screenshot effect | |
| uvc_ov2710 | Original image and captured screen image screenshot effect | |
FAQ
Q. I still don't know how to set up the programming environment after reading the above tutorial. What should I do?
- A. If you still don't understand how to set up the environment after reading the above tutorial, you can refer to the LilyGo-Document documentation for setup instructions.
Q. Why does my board keep failing to upload programs?
- A. Please hold down the "BOOT" button and try uploading the program again.
Q. Why can't I get a GPS fix when using the factory firmware?
- A.Burn the latest test program for our side and conduct the tests with the equipment placed outdoors or in an area with good signal. Other third-party firmware may still have some bugs that have not been resolved. The latest firmware address:
Q. Problems with not charging when powered off and severely shortened battery life
- A. The T-Display-P4 normally supports charging when powered off. The factory firmware can run for about 3‑5 hours at most; it does not include sleep. If you need sleep, refer to the sleep example.
Q. About ripple patterns on the OLED screen
- A. When observing screen ripples, pay attention to the battery level: if ripples become more noticeable at low battery, it is likely related to the battery; if ripples still occur frequently even with sufficient battery, check the components of the screen power supply circuit on the main board.
Q. About occasional freezing in the test page
- A. Please re‑test after flashing the latest firmware. If the freeze still appears randomly, you can contact us with a specific screenshot of the frozen page, and we will optimize the firmware accordingly. Latest firmware address: Factory.bin.
Q. About antenna interface function, transmission level, and GPS positioning issues
- A. For antenna interface function, transmission level, and GPS positioning issues, please refer to the following image settings:

On the current sx1262 version, only one of the two antenna ports on the case is connected; the other is not wired, so only one antenna port can be used.

Attached LoRa test image:

Q. About disassembling the device by yourself
- A. The silicone on the back is fixed with permanent adhesive. Disassembly will damage the appearance of the silicone. Disassembly video:
Q. About inaccurate battery level display and inability to charge when powered off
- A. Set the set_design_capacity parameter to 1000mAh in the firmware, then perform a full charge → natural discharge until power off → recharge cycle. The battery gauge will calibrate automatically. Note: after a complete power loss, recalibration is needed.
Q. Antenna interface related issues
- A. The MMCX2 interface marked on the case is reserved for internal testing and has no circuit connection. During initial testing, no signal level is output from that port. This device is an internal test version assembled for engineering purposes.
Q. Why do I fail when selecting the target compilation chip in the espidf framework or when configuring menuconfig in the SDK, reporting the following error:
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 the espidf framework v5.4~v5.5. You need to modify line 351 of the file at path
esp-idf-v5.x\tools\idf_py_actions\tools.pyas 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)
Projects
Resources
- ESP32-S3 Datasheet
- LR1121 Datasheet
- (More resources please refer to GitHub repository)