Skip to content

(m5stack_tab): changed ili9881c and gt911 drivers to st7123 (BSP-775)#710

Open
Throows wants to merge 1 commit intoespressif:masterfrom
Throows:master
Open

(m5stack_tab): changed ili9881c and gt911 drivers to st7123 (BSP-775)#710
Throows wants to merge 1 commit intoespressif:masterfrom
Throows:master

Conversation

@Throows
Copy link

@Throows Throows commented Jan 14, 2026

ESP-BSP Pull Request checklist

Note: For new BSPs create a PR with this link.

  • Version of modified component bumped
  • CI passing

Update for #695

M5Stack-Tab5 Driver change (ST7123)

Hello,
I've done a WIP fix of the tab5 driver change. It is working (tested with the Display example). but before merging, I am willing to find a solution to add a configuration to choose the old and the new Tab5 revision.

To try out by yourself

1 - Clone the repository (esp-bsp) with my changes 😅
2 - Create the display project
idf.py create-project-from-example "espressif/m5stack_tab5=1.0.0:display"
3 - edit the main/idf_component.yml

dependencies:
  m5stack_tab5:
    version: '*'
    override_path: "<PATH>"
    public: false
description: BSP Display example

where PATH is the relative path of 'esp-bsp/bsp/m5stack_tab5'
4 - Build flash monitor


Note

Updates the M5Stack Tab5 BSP to use ST7123 for both display and touch, with corresponding timing, init, and config changes.

  • Replace ILI9881C/GT911 with st7123 drivers: dependencies switched in idf_component.yml, BSP JSON, and code; new ST7123 init table in priv_include/disp_init_data.h
  • MIPI-DSI/DPI timing updated: dpi_clock_freq_mhz to 70, lane bitrate 965 Mbps, and new H/V porch/pulse defines in include/bsp/display.h; code now uses these defines
  • Default frame buffers for DPI set to 2 in Kconfig (enables avoid-tear modes); LVGL configs align accordingly
  • Backlight PWM frequency increased to 25 kHz
  • Touch stack migrated to ST7123 (I2C config/address), with GPIO23 INT line held low workaround retained
  • BSP metadata tweaks (YEAR 2026)

Written by Cursor Bugbot for commit 4160d14. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 14, 2026 22:03
@CLAassistant
Copy link

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the M5Stack Tab5 BSP to support a new hardware revision that uses the ST7123 display and touch controller, replacing the previous ILI9881C display driver and GT911 touch controller. The changes update driver dependencies, initialization sequences, display timing parameters, and related configuration.

Changes:

  • Replaced ILI9881C display driver with ST7123 driver, including updated MIPI DSI timing parameters and initialization sequence
  • Replaced GT911 touch controller with ST7123 touch driver
  • Updated display timing parameters and increased DPI clock frequency from 60MHz to 70MHz
  • Changed default frame buffer count from 1 to 2 in Kconfig

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bsp/m5stack_tab5/src/m5stack_tab5.c Updated driver includes, API calls, timing parameters, and touch controller initialization for ST7123
bsp/m5stack_tab5/priv_include/disp_init_data.h Replaced ILI9881C initialization sequence with ST7123 initialization data from M5Stack reference
bsp/m5stack_tab5/m5stack_tab5.json Updated driver names, timing parameters, initialization commands, and year field in BSP metadata
bsp/m5stack_tab5/include/bsp/display.h Added timing parameter macros and updated lane bitrate for ST7123
bsp/m5stack_tab5/idf_component.yml Updated component dependencies to ST7123 drivers and removed override_path for touch driver
bsp/m5stack_tab5/Kconfig Changed default frame buffer count from 1 to 2
Comments suppressed due to low confidence (1)

bsp/m5stack_tab5/m5stack_tab5.json:5

  • The BSP_DESC_LONG field still references the GT911 touch controller. This should be updated to reflect the new ST7123 touch controller or clarify hardware revision differences.
    "BSP_DESC_LONG": "**Tab5** is a highly extensible, portable smart IoT terminal development device designed for developers, integrating a dual-chip architecture and abundant hardware resources. Its main controller adopts the RISC‑V–based **ESP32‑P4** SoC, equipped with 16 MB Flash and 32 MB PSRAM; the wireless module uses the ESP32‑C6‑MINI‑1U, supporting Wi‑Fi 6. Its antenna system can freely switch between the built-in 3D antenna and the external MMCX antenna interface, flexibly adapting to different deployment environments to ensure data throughput and low-latency control.\r\n\r\nIn terms of vision and interaction, Tab5 features a 5″ 1280×720 IPS **TFT** display via a MIPI‑DSI interface, with touch handled by the GT911 multi-point **touch** controller (I2C) for a smooth and responsive touch experience; it also includes an SC2356 2 MP **camera** (1600×1200) via a MIPI‑CSI interface, capable of high-definition video recording, image processing, and edge AI applications (e.g., face recognition, object tracking).\r\n\r\nFor peripheral interfaces, Tab5 offers **USB‑A** (Host) and **USB‑C** (USB 2.0 OTG) ports for connecting traditional peripherals like a mouse or keyboard; industrial scenarios can use **RS‑485** (SIT3088 + DIP switch–selectable 120 Ω termination) bus communication. Grove, M5BUS, GPIO_EXT header, and **Micro SD** card slot, as well as reserved STAMP pads (supporting Cat.M, NB‑IoT, LoRaWAN, etc.), allow flexible expansion with various sensors and communication modules. It also includes Reset/Boot buttons for quick reset and entering firmware download mode.",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -652,7 +651,7 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
esp_lcd_panel_reset(ret_handles->panel);
esp_lcd_panel_init(ret_handles->panel);
esp_lcd_panel_invert_color(ret_handles->panel, false);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is commented out without explanation. If this function call is no longer needed for the ST7123 driver, it should be removed entirely. If it might be needed in the future or for certain configurations, add a comment explaining why it's disabled.

Suggested change
esp_lcd_panel_invert_color(ret_handles->panel, false);
esp_lcd_panel_invert_color(ret_handles->panel, false);
// The ST7123 panel used on M5Stack Tab5 is already in the desired orientation.
// Leave swap_xy disabled; enable this call only if a different mounting requires X/Y swap.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot changed the title (m5stack_tab): changed ili9881c and gt911 drivers to st7123 (m5stack_tab): changed ili9881c and gt911 drivers to st7123 (BSP-775) Jan 14, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

esp_lcd_panel_init(ret_handles->panel);
esp_lcd_panel_invert_color(ret_handles->panel, false);
esp_lcd_panel_swap_xy(ret_handles->panel, false);
//esp_lcd_panel_swap_xy(ret_handles->panel, false);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out code left in production commit

Low Severity

The esp_lcd_panel_swap_xy call was commented out rather than removed. This pattern typically indicates debug code or an incomplete change left in the codebase. Other BSPs in the repository actively call this function for panel configuration. If this was intentionally disabled for the ST7123 driver, the line should be removed entirely rather than left as a comment, which creates confusion about whether the behavior change was intentional.

Fix in Cursor Fix in Web

@espzav
Copy link
Collaborator

espzav commented Jan 15, 2026

Hi @Throows, thank you for this PR. We were planning to make it too, but we are waiting for HW (not in stock now). We have two issues here, which we should make decision:

  1. Original BSP was generated by our new BSP generator. It should be generated again for compatibility.
  2. The BSP should support both displays and both touch controllers (it is not possible now by BSP Generator)

I am thinking about it...

@Throows
Copy link
Author

Throows commented Jan 15, 2026

Hey 👋,
This is great then, I originally made this code for my personal project, so I am sharing it until your corrected version comes out for the impatients like me 😆.
Feel free to close the merge.

Also, I was wondering about the JSON file ? Is that automatically generated? Or is it the file that will be use to generate code ?

Great day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants