Description
Hello, I’ve got an issues where my widgets are flickering like in the attached video.
What MCU/Processor/Board and compiler are you using?
STM32H743IIT6 + SDRAM + LTDC Screen (custom board) with ChibiOS and GCC
What LVGL version are you using?
Current master (9.3)
What do you want to achieve?
Remove the flickering
What have you tried so far?
Using direct render mode and double buffering, additionally ported all RTOS functions to ChibiOS
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:
uint8_t frame_buffer[600 * 1024 * 2] __attribute__((section(".sdram"), aligned(32)));
uint8_t frame_buffer_optional[600 * 1024 * 2] __attribute__((section(".sdram"), aligned(32)));
uint8_t view_buffer[600 * 1024 * 2] __attribute__((section(".sdram"), aligned(32)));
static THD_WORKING_AREA(waLV_TIMER_HANDLER, 4096);
static THD_FUNCTION(LV_TIMER_HANDLER, arg)
{
(void)arg;
chRegSetThreadName("LV_TIMER_HANDLER");
uint32_t sleep = 0;
while (true)
{
sleep = lv_timer_handler();
if (sleep == LV_NO_TIMER_READY)
sleep = LV_DEF_REFR_PERIOD;
if (sleep <= 0)
sleep = 1;
chThdSleepMilliseconds(sleep);
}
}
static THD_WORKING_AREA(waLV_TICK, 2048);
static THD_FUNCTION(LV_TICK, arg)
{
(void)arg;
chRegSetThreadName("LV_TICK_HANDLER");
while (true)
{
lv_tick_inc(10);
chThdSleepMilliseconds(10);
}
}
static THD_WORKING_AREA(waLV_GFX, 4096);
static THD_FUNCTION(LV_GFX, arg)
{
(void)arg;
chRegSetThreadName("LV_GFX_HANDLER");
lv_lock();
ui_init();
lv_unlock();
float test = 0;
bool n = false;
while (true)
{
lv_lock();
for (int i = 0; i < 8; i++)
{
update_values(test, 0, i);
}
if(!n)
{
test += 0.5f;
}
else if (n)
{
test -= 0.5f;
}
if (test >= 100)
{
n = true;
}
else if (test <= 0)
{
n = false;
}
lv_unlock();
chThdSleepMilliseconds(10);
}
}
void startLVGL()
{
palSetPad(GPIOH, 6U);
ltdcInit();
ltdcStart(<DCD1, <dc_cfg);
dma2dInit();
dma2dStart(&DMA2DD1, &dma2d_cfg);
lv_init();
lv_display_t *disp = lv_st_ltdc_create_direct(view_buffer, frame_buffer_optional, 0);
chThdCreateStatic(waLV_TIMER_HANDLER, sizeof(waLV_TIMER_HANDLER), NORMALPRIO, LV_TIMER_HANDLER, NULL);
chThdCreateStatic(waLV_TICK, sizeof(waLV_TICK), NORMALPRIO, LV_TICK, NULL);
chThdCreateStatic(waLV_GFX, sizeof(waLV_GFX), NORMALPRIO, LV_GFX, NULL);
}

