This tutorial explains how to build the example program for using Unit PoE-P4 with AddOn Display In For PoE-P4. Users can perform secondary development based on this example.
v5.5.2. If a version later than v5.5.2 is used, changes to the underlying ESP-IDF MIPI DSI timing calculation logic may cause the display to flicker."." and the script in the . ./export.sh command. This command is equivalent to source ./export.sh.git clone -b v5.5.2 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh esp32p4
. ./export.sh In addition to Unit PoE-P4 and AddOn Display In For PoE-P4, this example also uses a 5.0-inch, 1280 x 720 resolution, 24P FPC ST7123 display assembly. If you use a different display, refer to Unit PoE-P4 MIPI DSI+TP+BL FPC Interface for interface details.
The idf.py commands used in the following steps depend on ESP-IDF. Before running the commands, call export.sh from ESP-IDF to activate the relevant environment variables. For details, please refer to ESP-IDF - ESP32-P4 Getting Started Guide.
Download the example source code for using Unit PoE-P4 with AddOn Display In For PoE-P4, and extract it.
Enter the M5Unit-PoE-P4-AddOn-Display-In-Example project folder and call export.sh from the esp-idf project to activate the relevant environment variables. (Modify the command according to the actual esp-idf path.)
cd M5Unit-PoE-P4-AddOn-Display-In-Example
. ~/.espressif/v5.5.2/esp-idf/export.sh
Connect Unit PoE-P4 to the computer using a data cable. Press and hold the reset button until the green indicator lights up, then release the button. The device will enter download mode and wait for firmware flashing.
Then execute the following commands to set the target chip and port (modify the last command as needed), build, and flash the program.
idf.py set-target esp32p4
idf.py build
idf.py -p /dev/ttyACM0 flash monitor
off.actual output signal resolution may differ from the resolution configured in the system, which may prevent the program from working correctly:After flashing is complete, follow these steps to connect the devices and display the HDMI input image:
1280 x 720 @ 60Hz.Intel® Graphics Command Center (Beta) (if it is not installed, download it from the Microsoft Store), click Display, and configure the settings as shown below:
M5DisplayIn -> Current Resolutions, and select 1280 x 720 in the Resolution column:
Active signal mode resolution appears as shown below.
This example uses LT6911D to convert the HDMI input signal into 2-Lane MIPI-CSI YUYV422 data, supporting two input resolutions: 1280 x 720 @ 60Hz and 1920 x 1080 @ 30Hz. ESP32-P4 configures the CSI controller according to the valid resolution and MIPI-CSI Lane rate detected by LT6911D, then writes complete image frames to PSRAM through CSI DMA. At 1280 x 720 @ 60Hz, the full image is displayed. At 1920 x 1080 @ 30Hz, a 1280 x 720 region is cropped from the center of the image without scaling. The program then uses both CPU cores to convert YUYV422 to BGR565, rotates the image 90° counterclockwise through PPA, and finally outputs it through 2-Lane MIPI-DSI to the 720 x 1280 ST7123P display. The actual CSI DMA capture frame rate is indicated by the Status: DMA=... (... FPS) serial log. The MIPI-DSI display scan refresh rate is independent of the HDMI input refresh rate.
