When running the for loop, the thread also executes all the time

When I open an lvgl page, it will first execute


Then at the bottom here, I wrote a

 lv_task_create(img_looper, 200, LV_TASK_PRIO_HIGHEST, NULL );

followed by

for (UINT32 i = 0; i <20000 ; ++i) {

When I run here, I find that the taskwill not continue to run until the end of this cycle.
How to solve this problem

LVGL’s tasks are not threads in the OS sense; they are just periodic timers that are fired by lv_task_handler (which was renamed to lv_timer_handler in v8 to address the confusion). To get the behavior you’re looking for, you would need to use a proper OS and mutexes.

Alternatively, you need to restructure your application logic so that it fits the model of periodic processing in timers that LVGL uses.