jakpaul / lvgl_touch_calibration

A complete lvgl screen object for performing calibration of a resistive touch panel.
MIT License
24 stars 8 forks source link

ESP32 Task WDT when calling lv_tc_screen_constructor on last ESP-IDF (5.4) when using spi_lcd_touch example #10

Open aopenna opened 1 month ago

aopenna commented 1 month ago

Hello, I tried to use your component on a modified spi_lcd_touch example from the ESP-IDF master branch, including the XPT2046 esp_lcd_touch driver component from ESP-Registry, which was working previously including your component.

I shared a repository with the modified example here

Problem: when your component calls the lv_tc_screen_constructor, the app hangs up, triggering the Task watchdog. I tried to figure out the problem but have little experience with LVGL. What I could observe is the hang-up occurs when a call to insert the cursor image on the screen is executed here: lv_image_set_src(tCScreenObj->indicatorObj, &lv_tc_indicator_img);

Questions: 1) Using esp_lcd and esp_lcd_touch managed_components together with your component is the expected way to work with it? If not, what do you expect to use? 2) Is there any working example with ESP-IDF that you could share?

If need additional info please let me know.

Thanks for any help.

aopenna commented 1 month ago

Hello, I figured out the solution. On the tcScreen object constructor, an explicit attribution must be added before line 121: tCScreenObj->screenObj = *obj;
otherwise, it will point to an unknown location that causes the code to run away. I could work if some LVGL + ESP-IDF version combination does an implicit attribution, but it did not work on the ESP-IDF 5.4 + LVGL 9.x.

There are also some minor corrections (add explicitly imports, conditional include for LVGL 9.2) that is needed to compile correctly then I will do a PR that includes all.