lvgl: performance problem with LVGL and STM32F746 (lv_task_handler)?

Hello

I have the following simple code running below. I’m measuring how regularly the LED toggles. If I exclude lv_task_handler(), it runs clean (the LED toggles all ms). If lv_task_handler is enabled there are about 4mS interruptions all 300ms, see image1 and 2?

And without lv_task_handler see image3 and 4.

I use a STM32F746 with LVGL 8.2. Is this all normal? Or do I have a performance/setting problem ?? It is very urgent for me, I’am glad for any hint…

Thank you

while (1){
    	////////////////// TESTCODE ///////////////////////////

        if( ( millis()-lastMillis2 ) > 4){
        	lv_task_handler();
        	lastMillis2 = millis();
        }

    	if( ( millis()-lastMillis1 ) >= 1){
    		HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_8); //LED 101
    		lastMillis1 = millis();
    	}
}

Image1 and 2:

lvtaskHandler300ms lvtaskHandler4ms

Image3 and 4:

noLvtaskHandler2 noLvtaskHandler

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Thank you. I have now updated from stm IDE 1.3 to IDE 1.9. After that i got some link errors like multiple definition regarding lv_meter_indicator_t * and lv_chart_series_t *. I have corrected that. (No idea why I did not get this error with IDE 1.3) Now interestingly there is no interruption every 300ms… So this problem looks solved…

EDIT,

My measurement here indicates that the bug is really in your HW config as it’s ~1000 times faster for me.

Thank you. I still have the problem with lv_meter/lv_arc. Recopy the whole lvgl-library did not help. If I put the following Code in the while loop, I receive the times see screenshot below.

        for(i = 0; i < 1000; i++) {
        	lv_meter_set_indicator_value(guider_ui.screen_meter_1, screen_meter_1_scale_1_ndimg_0, lv_rand(0, 100));
        }
        volatile uint32_t elaps = lv_tick_elaps(t);
        //printf("%d ms\n", elaps);
    	char buf8[20];
    	lv_snprintf(buf8, sizeof(buf8), "%lu\n\r", elaps);
    	//lv_snprintf(buf8, sizeof(buf8), "%d ms\n", elaps);
        HAL_UART_Transmit(&huart3,buf8,sizeof(buf8),1);

image

You’ll need to call lv_disp_flush_ready within the function if you comment everything else out, so LVGL thinks the display has been flushed.