How to enable FreeRTOS with LVGL 9.5 running on STM32N6570-DK board?

Hi everyone,

I am working on the STM32N6570-DK board and trying to run LVGL v9.5 with FreeRTOS, but I am facing issues integrating both properly.

What I have done so far:

  • Enabled FreeRTOS (CMSIS-RTOS v2)
  • Integrated LVGL v9.5 into the project
  • Initialized display and LVGL successfully (basic UI works without RTOS)

Issue:

  • When I enable FreeRTOS and run LVGL inside a task, and display behaves unexpectedly
  • It shows garbage pixels on display
  • Suspecting issues with:
    • lv_timer_handler() execution timing
    • Thread safety / mutex handling
    • Tick increment (lv_tick_inc) integration

What I tried:

  • Running lv_timer_handler() in a dedicated task with delay
  • Using mutex (xSemaphore) for LVGL calls
  • Checking stack size and task priority

Questions:

  1. What is the correct way to integrate LVGL 9.5 with FreeRTOS?
  2. How should lv_timer_handler() and lv_tick_inc() be handled in RTOS?
  3. Is there any official or recommended template for STM32N6 series?
  4. Are there any specific configurations required for STM32N6570-DK?

Additional Info:

  • MCU: STM32N657
  • LVGL Version: 9.5
  • RTOS: FreeRTOS (CMSIS v2)

Any guidance or working example would be really helpful.

Thanks in advance!

I mean this is still valid Operating system and interrupts — LVGL documentation

and primary you dont require lv_tick_inc , but hw based timer for lv_tick get
for example in arduino ESP simple is

lv_tick_set_cb(millis);

and main idea is place all lvgl parts in one task. Otherwise as describe docu.

1 Like

Hello,

Speaking from experience using the ThreadX RTOS,
If you are sure that you are initializing LVGL correctly, and your flush callback works, you should call lv_timer_handler() from your thread’s (I suppose FreeRTOS calls them ‘tasks’) main loop.

lv_tick_inc() should be called from an interrupt where you can fairly accurately gaurantee the ticks you need. So lv_tick_inc(1) from a 1000hz timer interrupt for instance.

Do not bother with multithreading LVGL itself, so long as you call all LVGL functions from other LVGL functions, it should work fine.

@Radhika-Changela Have you enabled FreeRTOS on lv_conf.h?

https://docs.lvgl.io/9.5/integration/rtos/freertos.html