Answers checklist.
- I have read the documentation SiFli-SDK Programming Guide and the issue is not addressed there.
- I have updated my SiFli-SDK branch (main or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
SiFli-SDK version.
v2.4.4-31-g3c762ea7
SiFli SoC revision.
SF32LB58
Operating System used.
macOS
Development Kit.
SF32LB58-DevKit-LCD MOD-A128R32N1
What is the expected behavior?
The behavior of lv_obj_set_style_opa_layered() should be as stable as lv_obj_set_style_opa()—it should not cause system freeze, even when the object is positioned outside the screen. It should not lead to thread deadlock.
What is the actual behavior?
The lcd_task thread stops running:
msh> ps
pri status sp top stack size max used left tick error
-------- --- ------- ---------- ---------- ---------- ------ ---------- ---
KE_EVT3 10 suspend 0x20058b80 0x20058c7c 0x00000400 25% 0x00000014 000
KE_EVT0 25 ready 0x20058748 0x20058790 0x00000400 07% 0x00000014 000
KE_EVT2 12 suspend 0x200581a8 0x200582a4 0x00001000 13% 0x00000014 000
device_m 25 suspend 0x2004e288 0x2004e398 0x00000800 36% 0x00000013 000
mbox 11 close 0x20050098 0x20050164 0x00001000 21% 0x0000000a 000
tpread 10 suspend 0x20020610 0x2002071c 0x00000400 26% 0x0000000a 000
lcd_task 12 suspend 0x200201b8 0x2002031c 0x00000800 43% 0x00000001 000 <-------
tshell 20 ready 0x2004b958 0x2004bad8 0x00001000 20% 0x0000000a 000
thread 4 suspend 0x200468f0 0x20046a14 0x00001000 44% 0x00000010 000
thread 3 suspend 0x200457c8 0x200458e0 0x00002000 06% 0x00000010 000
tidle 31 ready 0x000276b8 0x00027710 0x00000200 19% 0x00000019 000
timer 4 suspend 0x20021618 0x2002171c 0x00001000 06% 0x00000009 000
main 21 ready 0x200426d8 0x20042958 0x00002000 31% 0x00000013 000
LVGL no longer calls the display driver’s flush function. The screen freezes completely. The serial port remains functional and can print commands, but the entire GUI is frozen and requires a RESET.
Steps to reproduce.
- Create a
labelobject completely outside the screen (e.g., negative y-coordinate or beyond screen height), or partially outside. - Use an LVGL animation (
lv_anim_t) to animate opacity changes. - Inside the animation callback, call
lv_obj_set_style_opa_layered(). - The issue occurs whenever the object is positioned outside the visible screen area.
Tested: lv_label triggers this issue; a plain lv_obj (rectangle) does not.
Debug Logs.
More Information.
Reproduction code:
static void _set_opa_layered_cb(void *var, int32_t v)
{
lv_obj_set_style_opa_layered((lv_obj_t *)var, (lv_opa_t)v, 0);
}
lv_obj_t *scr = lv_screen_active();
lv_obj_t *l = lv_label_create(scr);
lv_label_set_text(l, "Hello World");
lv_obj_set_pos(l, -50, 200);
// Tested: plain obj works fine
// lv_obj_t *rect = lv_obj_create(scr);
// lv_obj_set_size(rect, 100, 100);
// lv_obj_set_pos(rect, -50, 200);
// lv_obj_set_style_bg_color(rect, EOS_COLOR_RED, 0);
// lv_obj_set_style_bg_opa(rect, LV_OPA_100, 0);
lv_anim_t anim;
lv_anim_t *a = &anim;
lv_anim_init(a);
lv_anim_set_var(a, l);
lv_anim_set_values(a, LV_OPA_100, LV_OPA_20);
lv_anim_set_exec_cb(a, _set_opa_layered_cb);
lv_anim_set_path_cb(a, lv_anim_path_ease_in_out);
lv_anim_set_duration(a, 1000);
lv_anim_set_delay(a, 0);
lv_anim_start(a);
System state:
Assertion failed at function:assert_command, line number:460 ,(0)
Previous ISR enable 0
===================
Thread Info
===================
pri status sp top stack size max used left tick error
-------- --- ------- ---------- ---------- ---------- ------ ---------- ---
KE_EVT3 10 suspend 0x20058b80 0x20058c7c 0x00000400 25% 0x00000014 000
KE_EVT0 25 ready 0x20058748 0x20058790 0x00000400 07% 0x00000014 000
KE_EVT2 12 suspend 0x200581a8 0x200582a4 0x00001000 13% 0x00000014 000
device_m 25 suspend 0x2004e288 0x2004e398 0x00000800 36% 0x00000013 000
mbox 11 close 0x20050098 0x20050164 0x00001000 21% 0x0000000a 000
tpread 10 suspend 0x20020610 0x2002071c 0x00000400 26% 0x0000000a 000
lcd_task 12 suspend 0x200201b8 0x2002031c 0x00000800 43% 0x00000001 000
tshell 20 ready 0x2004b958 0x2004bad8 0x00001000 21% 0x00000004 000
thread 4 suspend 0x200468f0 0x20046a14 0x00001000 44% 0x00000010 000
thread 3 suspend 0x200457c8 0x200458e0 0x00002000 06% 0x00000010 000
tidle 31 ready 0x000276b8 0x00027710 0x00000200 19% 0x00000019 000
timer 4 suspend 0x20021618 0x2002171c 0x00001000 06% 0x00000009 000
main 21 ready 0x20042718 0x20042958 0x00002000 31% 0x0000000d 000
===================
Mailbox Info
===================
entry size suspend thread
------- ---- ---- --------------
ble_mb 0000 0008 0
===================
MessageQueue Info
===================
entry suspend thread
-------- ---- --------------
device_c 0000 1:device_m
drv_lcd 0000 1:lcd_task�
===================
Mutex Info
===================
owner hold suspend thread
-------- -------- ---- --------------
ble_mute (null) 0000 0
tplck (null) 0000 0
dhara (null) 0000 0
fat0 (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex (null) 0000 0
mutex main 0001 0
rtc (null) 0000 0
ulog loc (null) 0000 0
fslock (null) 0000 0
i2c_bus_ (null) 0000 0
i2c_bus_ (null) 0000 0
i2c_bus_ (null) 0000 0
i2c_bus_ (null) 0000 0
spi1 (null) 0000 0
===================
Semaphore Info
===================
v suspend thread
-------- --- --------------
KE 000 1:KE_EVT3
KE 000 0
ke_mem_e 001 0
ke_mem_e 001 0
ke_mem_e 001 0
ke_mem_e 001 0
KE 000 1:KE_EVT2
sifli 000 0
btn 001 0
tp_ctrl 001 0
lv_lcd 001 0
lcd_msg 000 0
lcd_draw 000 0
drv_lcd 001 0
shrx 000 0
ft6146 000 1:tpread
sem 000 1:thread
epic 001 0
sem 000 1:thread
sem 044 0
psram_he 001 0
aes_drv 001 0
drv_eDma 001 0
nandlock 001 0
flash5 001 0
i2c4 000 0
i2c3 000 0
i2c2 000 0
i2c1 000 0
spi1 000 0
heap 001 0
===================
Memory Info
===================
total memory: 1751812 used memory : 104376 maximum allocated memory: 108644
===================
MemoryHeap Info
===================
pool size max used size available size
-------- ---------- ------------- --------------
psram_he 6291456 72 6291384
=====================
PSP: 0x0x2004b9fc, MSP: 0x0x20001fe0
=====================
sp: 0x2004ba58
psr: 0x40000000
r00: 0x00000000
r01: 0x00001c1f
r02: 0x00012a23
r03: 0x30000000
r12: 0x1009465d
lr: 0x1008413b
pc: 0x1008413b
=====================
fatal error on thread: tshell
Related Links
I have already submitted this issue on GitHub: LVGL v9 中对屏幕外的 lv_label 对象使用 lv_obj_set_style_opa_layered() 动画会导致lcd线程卡死 · Issue #217 · OpenSiFli/SiFli-SDK · GitHub