Good Morning Everyone!
I have a weird crash in my program ( I suspect a memory leak somewhere), dealing with adding objects to a rotary encoder group with lv_group_add_obj
LPC55S69 // GuiGuider V1.3.1-GA // MCUXpresso V11.4.0 build 6237 // LvGL 8.2.0 & 8.0.2
I have set up 3 screens in GuiGuider (Dashboard, Config, Charts) basically in a circle, each with 2 buttons.
Left button loads previous screen, Right button loads next screen
E.G. repeatedly clicking the right button will take you : Dashboard -> Config -> Charts -> Dashboard again
And repeatedly clicking on the left button will take you in the opposite sequence.
I am using a rotary encoder and in the driver I basically send back to LvGL the following
data->enc_diff = lvgl_RotaryEncoder_Diff; //+1 for a clockwise step, -1 for a CCW step
data->state = LV_INDEV_STATE_PRESSED;
data->state = LV_INDEV_STATE_RELEASED;
The above all works fine, screens render nicely, and responds to the users input via the rotary encoder . . . .
In my events_init.c, in the events_init function I've added code to create the lv_group thats required for the Rotary Encoder events to be processed, as well as linking the group to my rotary encoder
And on each button click event in events_init.c I remove all objects from the group before running the code to load the new screen with : lv_group_remove_all_objs(rotary_encoder_focused_objects_group);
And then I add the newly created screen's buttons to the group with : lv_group_add_obj(rotary_encoder_focused_objects_group, guider_ui.Charts_btn_left);
This all works fine, except after about the 6th+n screen changes there is an inevitable crash in lv_group_add_obj, see the attached lvgl_crash_info.txt
I've also attached some source file in the .zip file
Ive tried:
1. different versions of lvgl 7.1 8.0.2, 8.2.0
2. deleting the group and creating a new one on each screen change
3. setting the group to default
4. Consulting caffeine and spending endless late hours and early mornings looking at the code
But sadly, all to no avail
Kind regards
Gert
A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy