Skip to content

Waveshare ESP32-S3-Touch-LCD-4 - Unable to use touch and I2C sensor at the same time #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dinisfc opened this issue Jan 9, 2025 · 7 comments

Comments

@dinisfc
Copy link

dinisfc commented Jan 9, 2025

Currently testing a prototype built from the Squareline Porting example. This board uses the GT911 Touch controller which uses the same channel as any other I2C external device. I'm using a SEN66 sensor, using its library which requires the use of the Wire library. When I do this, panel->init() will fail and show something like this:

E (1506) i2c: i2c driver install error
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x42058aab PS : 0x00060330 A0 : 0x82001d2e A1 : 0x3fcaf8b0
A2 : 0x00000000 A3 : 0x3c060164 A4 : 0x00000010 A5 : 0x3fcaaf94
A6 : 0x00000024 A7 : 0x0000000a A8 : 0x8202fd80 A9 : 0x3fcaf890
A10 : 0x00000002 A11 : 0x3c060164 A12 : 0x3fcaf6d8 A13 : 0x3fcaf798
A14 : 0x3fcaf7e8 A15 : 0x3fcab140 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000008 LBEG : 0x40056f08 LEND : 0x40056f12 LCOUNT : 0x00000000

Backtrace: 0x42058aa8:0x3fcaf8b0 0x42001d2b:0x3fcaf8d0 0x42033681:0x3fcaf8f0 0x4037d062:0x3fcaf910

And then get stuck in a loop doing the same.

I'm using version 0.1.8 per the Waveshare instructions. I'm using an ESP IOExpander library, v0.0.4, altered by Waveshare, so updating any of this libraries breaks the code. I'm also using lv_conf.h by Waveshare. Being a dev board the connections can't be altered.

Would like to know if there's a way to not have the I2C error and if, maybe, making the updated library (0.2.2 as of posting) work be worth it.

Note: the LCD-4 and LCD-4.3 are not the same! For LCD-4, the custom board configurations are used.

@Lzw655
Copy link
Collaborator

Lzw655 commented Jan 9, 2025

Hi @dinisfc,

  1. For the conflict between this library and the Wire library on I2C, here's a solution: set ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST to 1 in ESP_Panel_Board_Custom.h. This way, the driver will not initialize the I2C host internally. You will then need to manually initialize the I2C host using Wire in your .ino file before initializing the panel.
  2. Since the Release v1.0.0 is in progress, I think it's better to update your project after it's ready.
  3. BTW, we can support the ESP32-S3-Touch-LCD-4 board in the library if it's helpful for you.

@dinisfc
Copy link
Author

dinisfc commented Jan 9, 2025

Thanks for the answer.
Setting ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST to 1 and having Wire.begin before anything else worked.

@dinisfc dinisfc closed this as completed Jan 9, 2025
@dinisfc
Copy link
Author

dinisfc commented Feb 6, 2025

I've since updated to 0.2.2 and I'm now having errors again, even with ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST at 1.
I'm getting:

E (5056) i2c: i2c driver install error
E (5057) ESP_PanelHost: [ESP_FAIL] begin(153): I2C[0] install driver failed
E (5057) ESP_Panel: init(470): Initialize host failed
E (5061) ESP_Panel: begin(489): Panel is not initialized
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x420273cb PS : 0x00060130 A0 : 0x82027445 A1 : 0x3fcaf8e0
A2 : 0x00000000 A3 : 0x3fcaf908 A4 : 0x3fcaf90c A5 : 0x3c071251
A6 : 0x0000001c A7 : 0x00000003 A8 : 0x0000001c A9 : 0x3fcaf8c0
A10 : 0x00000005 A11 : 0x3fcaf908 A12 : 0x3fcaf90c A13 : 0x00000000
A14 : 0x3fcaf790 A15 : 0xff000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000020 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffffe

Backtrace: 0x420273c8:0x3fcaf8e0 0x42027442:0x3fcaf900 0x4202751d:0x3fcaf930 0x420257a5:0x3fcaf950 0x4201eaec:0x3fcaf970 0x420329ba:0x3fcaf990 0x42001cef:0x3fcaf9b0 0x4203846d:0x3fcaf9d0 0x4037cfc6:0x3fcaf9f0

Wire.begin and the sensor's reading start function are both before the screen. Running only the sensor or screen does not cause this error. While the system enters a loop showing this error repeatedly, the sensor remains on and running.

@dinisfc dinisfc reopened this Feb 6, 2025
@Lzw655
Copy link
Collaborator

Lzw655 commented Feb 8, 2025

Hi @dinisfc,

Could you share the whole ESP_Panel_Board_Custom.h file? If the board uses an IO expander, which requires the use of the I2C bus, the ESP_PANEL_EXPANDER_SKIP_INIT_HOST should be disabled too.

@dinisfc
Copy link
Author

dinisfc commented Feb 10, 2025

Changing ESP_PANEL_EXPANDER_SKIP_INIT_HOST to 0 fixed it. Thanks.

@dinisfc dinisfc closed this as completed Feb 10, 2025
@betamoojw
Copy link

Hi @dinisfc,

  1. For the conflict between this library and the Wire library on I2C, here's a solution: set ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST to 1 in ESP_Panel_Board_Custom.h. This way, the driver will not initialize the I2C host internally. You will then need to manually initialize the I2C host using Wire in your .ino file before initializing the panel.
  2. Since the Release v1.0.0 is in progress, I think it's better to update your project after it's ready.
    3. BTW, we can support the ESP32-S3-Touch-LCD-4 board in the library if it's helpful for you.

I was wondering when we could use the ESP32-S3-Touch-LCD-4 board in the library. It will be helpful for the waveshare ESP32-S3-Touch-LCD-4 user without complex additional configuration.

@Lzw655
Copy link
Collaborator

Lzw655 commented Mar 12, 2025

Hi @dinisfc,

  1. For the conflict between this library and the Wire library on I2C, here's a solution: set ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST to 1 in ESP_Panel_Board_Custom.h. This way, the driver will not initialize the I2C host internally. You will then need to manually initialize the I2C host using Wire in your .ino file before initializing the panel.
  2. Since the Release v1.0.0 is in progress, I think it's better to update your project after it's ready.
    3. BTW, we can support the ESP32-S3-Touch-LCD-4 board in the library if it's helpful for you.

I was wondering when we could use the ESP32-S3-Touch-LCD-4 board in the library. It will be helpful for the waveshare ESP32-S3-Touch-LCD-4 user without complex additional configuration.

Hi @Y1hsiaochunnn, could you help us add support for ESP32-S3-Touch-LCD-4 in the library?

@Lzw655 Lzw655 reopened this Mar 12, 2025
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

No branches or pull requests

3 participants