Urgent performance problem with LVGL and STM32F7?


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. If lv_task_handler is enabled there are about 4…5mS interruptions all 300ms, see screenshot 1 ?

And without lv_task_handler see screenshot 2.

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…

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

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

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



Hi @epikao
Are you able to find solution for this?
If yes, can you please share. Thanks

@xpress_embedo lv_task_handler can sometimes take a long time to return depending on the tasks that need to be handled. Calculating and writing to a display can take a few clock cycles.

If you want something with precise timing, you should use the timers on your microcontroller to create interrupts and run timing specific code in the interrupt.