Open sukesh-ak opened 2 months ago
My earlier sample was inspired by this code snippet
https://github.com/espressif/esp-iot-solution/blob/master/components/gui/lvgl_gui/lvgl_gui.c
Hi @sukesh-ak,
We are using RecursiveMutex
because sometimes there is some code called from some LVGL callback which is call another LVGL code and it hnags. You can use normal Mutex
, but you should check where you call it and you cannot call it from LVGL callbacks.
Thanks for the response @espzav
I will find some time to write a sample to test without esp_lvgl_port
using only Mutex
to see where/why its crashing.
Will report back once I figure out a solution (if any).
I am working on a commercial project based on this sample which uses
esp_lvgl_port 2.0
https://github.com/sukesh-ak/IDF5-ESP_LCD-LVGL9I use
Observer
inlvgl 9
to bind and create API for the UI. I have usedlv_msg
inlvgl 8
for the same use case which is deprecated now. https://docs.lvgl.io/master/others/observer.htmlI am seeing several issues which were not there in the past like StackOverflow and other exceptions, even with simple less complicated UI elements.
Sample crashing stack
Its crashing where there is a line like below which updates the state (enable/disable) of a button. I didn't have to wrap these in lock/unlock earlier. Currently I have done that too and its still an issue.
I believe the issue is coming from RecursiveMutex since I have another sample with
lvgl 8
here which was using normal Mutex earlier without issues. Mutex Take/Leave was required only while showing a full screen unlike now. https://github.com/sukesh-ak/ESP32-TUX/blob/master/main/helpers/helper_display.hppSo the question is, do we need RecursiveMutex in this scenario? Or is there a specific reason for using it? I don't want to skip
esp_lv_port
for now unless I am stuck without a way out.