Description
I’m using LVGL 9.2.2 in ESP-IDF and trying to get a Waveshare ESP32-S3 device that has an LCD and capacitive touch panel attached to it. Their example files are built for LVGL 8 but my code is already written for LVGL 9 and I’d prefer to use that.
I ported over their CST328.c driver by mostly copying it from their project. Here’s a link to my driver code:
In waveshare.c
(q-tune/main/waveshare/waveshare.c at 0b62a9e731ff5fab5582c96e4eb974eaed0c4c06 · joulupukki/q-tune · GitHub) I initialize the CST328 touch panel (TOUCH_Init is defined in the
CST328.cfile) and then I call
lvgl_port_add_touch()`.
I get a few touches out of the panel but then the app is crashing in this manner:
E (16405) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (16405) task_wdt: - IDLE0 (CPU 0)
E (16405) task_wdt: Tasks currently running:
E (16405) task_wdt: CPU 0: taskLVGL
E (16405) task_wdt: CPU 1: IDLE1
E (16405) task_wdt: Print CPU 0 (current core) backtrace
Backtrace: 0x42049813:0x3FC9A7A0 0x42049C30:0x3FC9A7C0 0x403779F9:0x3FC9A7F0 0x4201D682:0x3FCB9740 0x42018C36:0x3FCB9780 0x42018C6D:0x3FCB97B0 0x42016CF3:0x3FCB97E0 0x42016F12:0x3FCB9830 0x42016F69:0x3FCB9850 0x42067675:0x3FCB9890 0x42032639:0x3FCB98B0 0x42067675:0x3FCB9900 0x42017FFA:0x3FCB9920 0x4201808A:0x3FCB9940 0x42026488:0x3FCB9980 0x42026A1B:0x3FCB99A0 0x42026E21:0x3FCB99C0 0x4202734D:0x3FCB99E0 0x42014315:0x3FCB9A20 0x4037F65D:0x3FCB9A40
--- 0x42049813: task_wdt_timeout_handling at /Users/boyd/esp/v5.3.2/esp-idf/components/esp_system/task_wdt/task_wdt.c:434
0x42049c30: task_wdt_isr at /Users/boyd/esp/v5.3.2/esp-idf/components/esp_system/task_wdt/task_wdt.c:507
0x403779f9: _xt_lowint1 at /Users/boyd/esp/v5.3.2/esp-idf/components/xtensa/xtensa_vectors.S:1240
0x4201d682: lv_inv_area at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_refr.c:274
0x42018c36: lv_obj_invalidate_area at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_pos.c:838 (discriminator 1)
0x42018c6d: lv_obj_invalidate at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_pos.c:854
0x42016cf3: update_obj_state at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj.c:908
0x42016f12: lv_obj_add_state at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj.c:313
0x42016f69: lv_obj_event at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj.c:730
0x42067675: lv_obj_event_base at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_event.c:89
0x42032639: lv_checkbox_event at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/widgets/checkbox/lv_checkbox.c:173
0x42067675: lv_obj_event_base at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_event.c:89
0x42017ffa: event_send_core at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_event.c:364
0x4201808a: lv_obj_send_event at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/core/lv_obj_event.c:67
0x42026488: send_event at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/indev/lv_indev.c:1697
0x42026a1b: indev_proc_press at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/indev/lv_indev.c:1233
0x42026e21: indev_pointer_proc at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/indev/lv_indev.c:715
0x4202734d: lv_indev_read at /Users/boyd/projects/esp32/q-tune/managed_components/lvgl__lvgl/src/indev/lv_indev.c:249
0x42014315: lvgl_port_task at /Users/boyd/projects/esp32/q-tune/managed_components/espressif__esp_lvgl_port/src/lvgl9/esp_lvgl_port.c:255
0x4037f65d: vPortTaskWrapper at /Users/boyd/esp/v5.3.2/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139
What MCU/Processor/Board and compiler are you using?
I’m using a Waveshare ESP32-S3 Touch LCD 2.8: https://www.waveshare.com/esp32-s3-touch-lcd-2.8.htm?sku=27690
What LVGL version are you using?
LVGL 9
What do you want to achieve?
I’d like to add touch screen support to my device without it crashing.
What have you tried so far?
I’ve tried following the crash trace but not sure why it’s happening and don’t yet have the expertise to know what to look for.
I’ve tried also increasing the task watchdog timer to 10 seconds (from the default) 5, but that doesn’t seem to help.
I’m trying to use the touch panel as an additional way to navigation some screens that allow the user to configure user settings. One thing I’ve noticed is that when the touches do run, it sometimes automatically sends a touch to a sub screen and so if a button from the parent screen lines up with a button on the sub screen, as soon as the sub screen appears (before I can even see it), it already activates the sub screen button and action.
Any ideas on where to start figuring out what might be causing this?