Skip to content

fix: T-Deck (plus) touch TP INT behavior#327

Merged
mverch67 merged 4 commits into
masterfrom
tdeck-touch-fix
Jun 18, 2026
Merged

fix: T-Deck (plus) touch TP INT behavior#327
mverch67 merged 4 commits into
masterfrom
tdeck-touch-fix

Conversation

@mverch67

Copy link
Copy Markdown
Collaborator

This PR fixes the T-Deck Plus touch driver issue and re-introduces the more efficient GT911 touch driver.

During startup the following debug log information is printed: CONSTANT LOW LEVEL ON TOUCH

DEBUG | ??:??:?? 1 [DeviceUI] Display driver init...
DEBUG | ??:??:?? 1 [DeviceUI] LGFXDriver<LGFX>::init...
DEBUG | ??:??:?? 1 [DeviceUI] LGFX init...
DEBUG | ??:??:?? 2 [DeviceUI] GT911 I2C config: port=0 addr=0x14 sda=18 scl=8 freq=400000
DEBUG | ??:??:?? 2 [DeviceUI] --- GT911 Chip Identification ---
DEBUG | ??:??:?? 2 [DeviceUI] Product ID:        911
DEBUG | ??:??:?? 2 [DeviceUI] Firmware Version:  0x1060
DEBUG | ??:??:?? 2 [DeviceUI] Screen Resolution: 240 x 320
DEBUG | ??:??:?? 2 [DeviceUI] --- GT911 Configuration Diagnostics ---
DEBUG | ??:??:?? 2 [DeviceUI] Config Version (Reg 0x8047): 0x47  (Normal range)
DEBUG | ??:??:?? 2 [DeviceUI] Module_Switch1 (Reg 0x804D): 0xB6
INFO  | ??:??:?? 2 [DeviceUI] Current TP INT Driver Mode:  0x02 (CONSTANT LOW LEVEL ON TOUCH)
DEBUG | ??:??:?? 2 [DeviceUI] DisplayDriver init...
DEBUG | ??:??:?? 2 [DeviceUI] LV init...
DEBUG | ??:??:?? 2 [DeviceUI] LVGL display driver init...
DEBUG | ??:??:?? 2 [DeviceUI] LVGL: allocating 57600 bytes PSRAM for draw buffer (max free PSRAM: 3080180)
DEBUG | ??:??:?? 2 [DeviceUI] Input driver init...
DEBUG | ??:??:?? 2 [DeviceUI] I2CKeyboardScanner scanning...
INFO  | ??:??:?? 2 [DeviceUI] Registered I2C keyboard: T-Deck Keyboard at address 0x55
DEBUG | ??:??:?? 2 [DeviceUI] Panel id=0xffffffff (320x240): rst:-1, busy:-1, offX:0, offY:0 invert:0, RGB:0, rotation:0, offR:1, read:1, readP:8, readB:1, dlen:0, colordepth:16
DEBUG | ??:??:?? 2 [DeviceUI] Bus_SPI(1): clk:40, miso:38, mosi:41, dc:11, 3wire:0, dma:3
DEBUG | ??:??:?? 2 [DeviceUI] Touch int:16, rst:-1, rotation:0, (0/0)-(319/239) 
DEBUG | ??:??:?? 2 [DeviceUI] Touch I2C(0:0x14): SCL:8, SCA:18, freq:400000 
DEBUG | ??:??:?? 2 [DeviceUI] BL pin assigned
DEBUG | ??:??:?? 2 [DeviceUI] scanning log folder /messages
INFO  | ??:??:?? 2 [DeviceUI] LogRotate: found 0 log files using 0 bytes (0%).
INFO  | ??:??:?? 2 [DeviceUI] Logging to /messages/log_000001.log
DEBUG | ??:??:?? 2 [DeviceUI] DeviceScreen::init() done.

In case the display driver has a different configuration from the factory or OEM vendor then an attempt is made to reconfigure the GT911 driver and store the configuration persistently.

Note:
After first start the T-Deck touch display may require calibration (settings -> screen calibration) to work accurately.

@mverch67 mverch67 added the bug Something isn't working label Jun 16, 2026
@t-miura

t-miura commented Jun 16, 2026

Copy link
Copy Markdown

thank you for new PR!
now i'm dumping current flash's content to prepare the clean flash,
I'll post the log of very first&clean boot with meshtastic-firmware v2.7.25 + this device-ui.

@t-miura

t-miura commented Jun 16, 2026

Copy link
Copy Markdown

mhm! my T-Deck Plus shows different line: Current TP INT Driver Mode: 0x01 (Falling Edge Trigger)
and looks like it sucessfully changed to 0x02 (CONSTANT LOW LEVEL ON TOUCH).

And manual calibration was required, result log: DEBUG | ??:??:?? 107 [DeviceUI] Touchscreen calibration parameters: {6, 15, 6, 313, 224, 13, 233, 312}

following is the very first, clean boot log(partially)

DEBUG | ??:??:?? 2 [DeviceUI] Display driver init...
DEBUG | ??:??:?? 2 [DeviceUI] LGFXDriver<LGFX>::init...
DEBUG | ??:??:?? 2 [DeviceUI] LGFX init...
DEBUG | ??:??:?? 2 [DeviceUI] GT911 I2C config: port=0 addr=0x5D sda=18 scl=8 freq=400000
DEBUG | ??:??:?? 2 [DeviceUI] --- GT911 Chip Identification ---
DEBUG | ??:??:?? 3 [DeviceUI] Product ID:        911
DEBUG | ??:??:?? 3 [DeviceUI] Firmware Version:  0x1060
DEBUG | ??:??:?? 3 [DeviceUI] Screen Resolution: 240 x 320
DEBUG | ??:??:?? 3 [DeviceUI] --- GT911 Configuration Diagnostics ---
DEBUG | ??:??:?? 3 [DeviceUI] Config Version (Reg 0x8047): 0x41  (Normal range)
DEBUG | ??:??:?? 3 [DeviceUI] Module_Switch1 (Reg 0x804D): 0xB5
INFO  | ??:??:?? 3 [DeviceUI] Current TP INT Driver Mode:  0x01 (Falling Edge Trigger)
INFO  | ??:??:?? 3 [DeviceUI] GT911 TP_INT mode confirmed constant LOW after write (version=0x42)
DEBUG | ??:??:?? 3 [DeviceUI] DisplayDriver init...
DEBUG | ??:??:?? 3 [DeviceUI] LV init...
DEBUG | ??:??:?? 3 [DeviceUI] LVGL display driver init...
DEBUG | ??:??:?? 3 [DeviceUI] LVGL: allocating 57600 bytes PSRAM for draw buffer (max free PSRAM: 3080180)
DEBUG | ??:??:?? 3 [DeviceUI] Input driver init...
DEBUG | ??:??:?? 3 [DeviceUI] I2CKeyboardScanner scanning...
DEBUG | ??:??:?? 4 [DeviceUI] No I2C keyboards found
DEBUG | ??:??:?? 4 [DeviceUI] Panel id=0xffffffff (320x240): rst:-1, busy:-1, offX:0, offY:0 invert:0, RGB:0, rotation:0, offR:1, read:1, readP:8, readB:1, dlen:0, colordepth:16
DEBUG | ??:??:?? 4 [DeviceUI] Bus_SPI(1): clk:40, miso:38, mosi:41, dc:11, 3wire:0, dma:3
DEBUG | ??:??:?? 4 [DeviceUI] Touch int:16, rst:-1, rotation:0, (0/0)-(319/239)
DEBUG | ??:??:?? 4 [DeviceUI] Touch I2C(0:0x5d): SCL:8, SCA:18, freq:400000
DEBUG | ??:??:?? 4 [DeviceUI] BL pin assigned
INFO  | ??:??:?? 4 [DeviceUI] LogRotate: no log files found.
INFO  | ??:??:?? 4 [DeviceUI] Logging to /messages/log_000001.log
DEBUG | ??:??:?? 4 [DeviceUI] DeviceScreen::init() done.

and, next boot just after the calibration:

DEBUG | ??:??:?? 2 [DeviceUI] GT911 I2C config: port=0 addr=0x5D sda=18 scl=8 freq=400000
DEBUG | ??:??:?? 2 [DeviceUI] --- GT911 Chip Identification ---
DEBUG | ??:??:?? 2 [DeviceUI] Product ID:        911
DEBUG | ??:??:?? 2 [DeviceUI] Firmware Version:  0x1060
DEBUG | ??:??:?? 2 [DeviceUI] Screen Resolution: 240 x 320
DEBUG | ??:??:?? 2 [DeviceUI] --- GT911 Configuration Diagnostics ---
DEBUG | ??:??:?? 2 [DeviceUI] Config Version (Reg 0x8047): 0x42  (Normal range)
DEBUG | ??:??:?? 2 [DeviceUI] Module_Switch1 (Reg 0x804D): 0xB6
INFO  | ??:??:?? 2 [DeviceUI] Current TP INT Driver Mode:  0x02 (CONSTANT LOW LEVEL ON TOUCH)

now i'll test with actual message logs, by flashing my dump back and do dirty-flash.
this may reveals what happens if someone updates their T-Deck/Plus from previous version(without this patch).

@mverch67

Copy link
Copy Markdown
Collaborator Author

mhm! my T-Deck Plus shows different line: Current TP INT Driver Mode: 0x01 (Falling Edge Trigger)

Nice. It worked perfectly :)

That Falling Edge Trigger is the actual reason why the touch didn't work on 50% of all T-Deck Plus devices. now that it is configured properly the more efficient touch driver should avoid all those accidental long presses or unusable drop down menus. Please report if these work well now.

@t-miura

t-miura commented Jun 16, 2026

Copy link
Copy Markdown

just done that, and it seems everything's working fine for me 🎉
after the restore and dirty-flash, GT911's config was kept intact:

DEBUG | ??:??:?? 4 [DeviceUI] GT911 I2C config: port=0 addr=0x5D sda=18 scl=8 freq=400000
DEBUG | ??:??:?? 4 [DeviceUI] --- GT911 Chip Identification ---
DEBUG | ??:??:?? 4 [DeviceUI] Product ID:        911
DEBUG | ??:??:?? 4 [DeviceUI] Firmware Version:  0x1060
DEBUG | ??:??:?? 4 [DeviceUI] Screen Resolution: 240 x 320
DEBUG | ??:??:?? 4 [DeviceUI] --- GT911 Configuration Diagnostics ---
DEBUG | ??:??:?? 4 [DeviceUI] Config Version (Reg 0x8047): 0x42  (Normal range)
DEBUG | ??:??:?? 4 [DeviceUI] Module_Switch1 (Reg 0x804D): 0xB6
INFO  | ??:??:?? 4 [DeviceUI] Current TP INT Driver Mode:  0x02 (CONSTANT LOW LEVEL ON TOUCH)

while calibration was required again, as this was surely not stored in previous flash's configs.
DEBUG | ??:??:?? 45 [DeviceUI] Touchscreen calibration parameters: {6, 11, 6, 304, 230, 10, 230, 305}

on channel with plenty of message logs(especially today as we had bit larger earthquake tonight),
there were zero unwanted behavior, at least no sudden jump to the nodes list!
and other touch input seems working fine, just requires one-time calibration.

just my opinion, but forced first-time calibration(just like good old CE devices) will be nice for less confusing update process.

i'll see how it works in more depth, with some time, and report back in a day or so.
thanks again for this fix(also kudos to ItsLimitlezz for trying to fix issue without swapping the driver)

(by the way...is there actually no feature on long-press the message...?
i just realized there were no mention about that in official docs, so that was issue, not the feature, wow.)

@t-miura

t-miura commented Jun 16, 2026

Copy link
Copy Markdown

sorry that i might have spoke too soon, but there is one major issue: keyboard seems to be not working.
and this might be related to first boot's log:
DEBUG | ??:??:?? 4 [DeviceUI] No I2C keyboards found

this line also confirmed on dirty-flashed one's boot log.
strange thing is, that was not happened on your log, sucessfully reg'd the T-Deck Keyboard.
so there might be something i did wrong with the build, trying clean build again to see if it's reproducable or not.

for a comparsion, previous flash's content(without this patch but with previous closed PR)'s bootlog was showing:

[DeviceUI] I2CKeyboardScanner scanning...
[DeviceUI] Registered I2C keyboard: T-Deck Keyboard at address 0x55

quick update before i (try to) sleep:
tried clean build(pio run -e t-deck-tft -t clean, then build), still no luck with keyboard somehow.
interestingly, the firmware side does sees the keyboard exists on I2C bus, but not on device-ui side, hmm.
maybe using 2.7.25 on meshtastic side was the root cause?

INFO  | ??:??:?? 2 Scan for i2c devices
DEBUG | ??:??:?? 2 Scan for I2C devices on port 1
DEBUG | ??:??:?? 2 Register value from 0x40: 0xffff
DEBUG | ??:??:?? 2 Register MFG_UID: 0xffff
INFO  | ??:??:?? 2 INA219 found at address 0x40
DEBUG | ??:??:?? 2 Register value from 0x55: 0x0
INFO  | ??:??:?? 2 TDECKKB found at address 0x55
INFO  | ??:??:?? 2 SFA30 found at address 0x5d
INFO  | ??:??:?? 2 3 I2C devices found
*snip*
DEBUG | ??:??:?? 3 [DeviceUI] Display driver init...
DEBUG | ??:??:?? 3 [DeviceUI] LGFXDriver<LGFX>::init...
DEBUG | ??:??:?? 3 [DeviceUI] LGFX init...
DEBUG | ??:??:?? 3 [DeviceUI] GT911 I2C config: port=0 addr=0x5D sda=18 scl=8 freq=400000
DEBUG | ??:??:?? 3 [DeviceUI] --- GT911 Chip Identification ---
DEBUG | ??:??:?? 3 [DeviceUI] Product ID:        911
DEBUG | ??:??:?? 3 [DeviceUI] Firmware Version:  0x1060
DEBUG | ??:??:?? 3 [DeviceUI] Screen Resolution: 240 x 320
DEBUG | ??:??:?? 3 [DeviceUI] --- GT911 Configuration Diagnostics ---
DEBUG | ??:??:?? 3 [DeviceUI] Config Version (Reg 0x8047): 0x42  (Normal range)
DEBUG | ??:??:?? 3 [DeviceUI] Module_Switch1 (Reg 0x804D): 0xB6
INFO  | ??:??:?? 3 [DeviceUI] Current TP INT Driver Mode:  0x02 (CONSTANT LOW LEVEL ON TOUCH)
DEBUG | ??:??:?? 3 [DeviceUI] DisplayDriver init...
DEBUG | ??:??:?? 3 [DeviceUI] LV init...
DEBUG | ??:??:?? 3 [DeviceUI] LVGL display driver init...
DEBUG | ??:??:?? 3 [DeviceUI] LVGL: allocating 57600 bytes PSRAM for draw buffer (max free PSRAM: 3080180)
DEBUG | ??:??:?? 3 [DeviceUI] Input driver init...
DEBUG | ??:??:?? 3 [DeviceUI] I2CKeyboardScanner scanning...
DEBUG | ??:??:?? 4 [DeviceUI] No I2C keyboards found

@mverch67

Copy link
Copy Markdown
Collaborator Author

sorry that i might have spoke too soon, but there is one major issue: keyboard seems to be not working.

please check again. I've reset the I2C bus after lovyanGFX messes around with it

@t-miura

t-miura commented Jun 16, 2026

Copy link
Copy Markdown

Thank you for the fast response! tried with new commit just now,
I'm happy to report that now the keyboard is also working fine as well as touchscreen and trackball!

just my hunch, there may be different firmware loaded on keyboard-side ESP32C3 causing this difference.
or, just some dependency differences between 2.7.25 and newer commits/branches.
my unit is from AliExpress' LILYGO Official Store bought on end of Sep. 2025, FYI.
since updating keyboard's firmware is bit tricky and requires some soldering, that fix is so valuable and possibly essential, if that's true.

logs:

INFO  | ??:??:?? 3 INA219 found at address 0x40
DEBUG | ??:??:?? 3 Register value from 0x55: 0x0
INFO  | ??:??:?? 3 TDECKKB found at address 0x55
INFO  | ??:??:?? 3 SFA30 found at address 0x5d
INFO  | ??:??:?? 3 3 I2C devices found
*snip*
INFO  | ??:??:?? 4 [DeviceUI] Current TP INT Driver Mode:  0x02 (CONSTANT LOW LEVEL ON TOUCH)
*snip*
DEBUG | ??:??:?? 4 [DeviceUI] Input driver init...
DEBUG | ??:??:?? 4 [DeviceUI] I2CKeyboardScanner scanning...
INFO  | ??:??:?? 4 [DeviceUI] Registered I2C keyboard: T-Deck Keyboard at address 0x55

As my T-Deck Plus is set to use Power Saving(may go both light/deep sleep),
it seems like it's also working fine after it wakes up from both sleep mode too.

I'll test it for some more longer time, to see if i can find anything that's related to this PR.
Hope it'll work well on other's T-Deck/Plus, looking forward too for other's report.

@t-miura

t-miura commented Jun 18, 2026

Copy link
Copy Markdown

quick sitrep: no problem, so far so great! 🎉
everything seems to be working just fine, doing its job smoothly on my bedside(yes, my T-Deck Plus is bedside node)

that said, the "first-time calibration" will be a nice add-on improvemnt,
as i had to do calibration again after i dirty-flashed last build over non-key-working one.

not sure why it happened, but i think it's actually good to "forget" the previous calibration data on updating firmware,
as firmware's change might not work well with previous calibration values, just needs manual calibration for now.

since i use this as every-day-bedside(not carry 😄 ) node, so if i notice something, i'll report them as well.
but if nothing strange happens, this'll be my last report that this fix does fixes the issue, at last!(surely will ;-)

@mverch67 mverch67 merged commit 6cadf54 into master Jun 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants