Custom Slider Causes An Error


I have two screens, I am changing between them with below code without any touch event.

lv_screen_load_anim(screen_1, LV_SCR_LOAD_ANIM_NONE, 0, 0, true);

Screens change successfully if there is no custom style slider. Even if there is a slider ,it changes in success. I have added custom slider as below:

    /*Create a transition*/
   static const lv_style_prop_t props[] = {LV_STYLE_BG_COLOR, 0};
   static lv_style_transition_dsc_t transition_dsc;
    lv_style_transition_dsc_init(&transition_dsc, props, NULL, 0, 0, NULL);

    static lv_style_t style_main;
    static lv_style_t style_indicator;
    static  lv_style_t style_knob;

    lv_style_set_bg_opa(&style_main, LV_OPA_COVER);
    lv_style_set_bg_color(&style_main, lv_color_hex(0xa2a4a7));
    lv_style_set_radius(&style_main, LV_RADIUS_CIRCLE);
    lv_style_set_pad_ver(&style_main, -2); /*Makes the indicator larger*/

    lv_style_set_bg_opa(&style_indicator, LV_OPA_COVER);
    lv_style_set_bg_color(&style_indicator, lv_color_hex(0x113dd8));
    lv_style_set_radius(&style_indicator, LV_RADIUS_CIRCLE);
    lv_style_set_transition(&style_indicator, &transition_dsc);

    lv_style_set_bg_opa(&style_knob, LV_OPA_COVER);
    lv_style_set_bg_color(&style_knob, lv_color_hex(0xffffff));
    lv_style_set_border_color(&style_knob, lv_color_hex(0x032ba1));
    lv_style_set_border_width(&style_knob, 5);
    lv_style_set_radius(&style_knob, LV_RADIUS_CIRCLE);
    lv_style_set_pad_all(&style_knob, 15); /*Makes the knob larger*/
    lv_style_set_transition(&style_knob, &transition_dsc);

    /*Create a slider and add the style*/
    slider_volume = lv_slider_create(screen_1);
    lv_obj_remove_style_all(slider_volume);        /*Remove the styles coming from the theme*/

    lv_obj_add_style(slider_volume, &style_main, LV_PART_MAIN);
    lv_obj_add_style(slider_volume, &style_indicator, LV_PART_INDICATOR);
    lv_obj_add_style(slider_volume, &style_knob, LV_PART_KNOB);

	lv_slider_set_range(slider_volume, 0, 100);
	lv_slider_set_mode(slider_volume, LV_SLIDER_MODE_NORMAL);
	lv_slider_set_value(slider_volume, 50, LV_ANIM_OFF);
	lv_obj_set_pos(slider_volume, 334, 443);
	lv_obj_set_size(slider_volume, 450, 10);

After some time, I see below log in console. How should I modify my code to not get this error?

[Error]	(111.356, +111356)	 img_draw_core: Asserted at expression: tmp_buf != NULL Out of memory lv_draw_sw_img.c:275

What MCU/Processor/Board and compiler are you using?

IMXRT 1176

What LVGL version are you using?


What do you want to achieve?

I want to change pages with custom slider successfully

What have you tried so far?

I have tried styles to add different objects in pages, the situation is same, I get the same error. So it seems it is about lv_style_t objects.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

When I use local styles it changes as expected without error but I am not sure if it works robust or not.

lv_obj_set_style_bg_opa(slider_volume, LV_OPA_COVER, LV_PART_MAIN);
lv_obj_set_style_bg_color(slider_volume, lv_color_hex(0xa2a4a7), LV_PART_MAIN);
lv_obj_set_style_radius(slider_volume, LV_RADIUS_CIRCLE, LV_PART_MAIN);
lv_obj_set_style_pad_ver(slider_volume, -2, LV_PART_MAIN); /*Makes the indicator larger*/

lv_obj_set_style_bg_color(slider_volume, lv_color_hex(0x113dd8), LV_PART_INDICATOR);
lv_obj_set_style_bg_opa(slider_volume, LV_OPA_COVER, LV_PART_INDICATOR);
lv_obj_set_style_radius(slider_volume, LV_RADIUS_CIRCLE, LV_PART_INDICATOR);