-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Problem Summary
When trying to either:
- add new tests to the demo in lv_demo_benchmark to evaluate other items
- remove the demo call to begin creating my own UI here:
lv_port_stm32u5g9j-dk2/Core/Src/main.c
Line 143 in ab35c3e
lv_demo_benchmark();
I have noticed that sometimes the text is rendered as garbled text such as:

Reproduction steps:
Comment out the line
lv_port_stm32u5g9j-dk2/Core/Src/main.c
Line 143 in ab35c3e
| lv_demo_benchmark(); |
Replace with example Bar code: https://docs.lvgl.io/master/details/widgets/bar.html#styling-a-bar
contains surrounding context:
/* USER CODE BEGIN 2 */
lvgl_port_init();
static lv_style_t style_bg;
static lv_style_t style_indic;
lv_style_init(&style_bg);
lv_style_set_border_color(&style_bg, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_border_width(&style_bg, 2);
lv_style_set_pad_all(&style_bg, 6); /*To make the indicator smaller*/
lv_style_set_radius(&style_bg, 6);
lv_style_set_anim_duration(&style_bg, 1000);
lv_style_init(&style_indic);
lv_style_set_bg_opa(&style_indic, LV_OPA_COVER);
lv_style_set_bg_color(&style_indic, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_radius(&style_indic, 3);
lv_obj_t * bar = lv_bar_create(lv_screen_active());
lv_obj_remove_style_all(bar); /*To have a clean start*/
lv_obj_add_style(bar, &style_bg, 0);
lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR);
lv_obj_set_size(bar, 200, 20);
lv_obj_center(bar);
lv_bar_set_value(bar, 100, LV_ANIM_ON);
//lv_demo_benchmark();
Solution discussion
I have isolated the problem down to when
lv_port_stm32u5g9j-dk2/Core/Src/main.c
Line 131 in ab35c3e
| MX_DCACHE2_Init(); |
this line is commented out, disabling the use of DCACHE2, the text garbling goes away. Note that DACHE1 is coupled with the CPU while DCACHE2 is coupled with the DMA2D.
This makes me think that there may be a cache decoherence problem that is occurring between DCACHE1, SRAM and DCACHE2. I am wondering if you have run into this problem before. What is interesting is that the demo as is seems to work just fine, but I only run into issues when I begin modifying this project.
In order to make use of the DCACHE2's performance increase, I am wondering if we have to add a strategy to managing the caches such as:
However I am not sure where would be the most appropriate or best lvgl practiced place to put this.

