cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error after integrating lvgl in stm32u5 dk1 board

Rohit-Trustedwear
Associate

I am new to firmware and integrated LVGL in stm32u5 dk1 board . And my elf hex file size is bigger than internal flash hence using external flash for lvgl images . Also running LVGL in external psram . After running I see first screen then it goes immediately to hardfault . Not able to understand this hardfault reason . Need help here . And I checked that PSRAM and External flash is working fine . I have copied entire code at github https://github.com/rohit-trustedwear/stm32dk1-code . the fault is happening at line bg_color.full = buf[0] + (buf[1] << 8); in

#if LV_COLOR_SCREEN_TRANSP
static inline void set_px_argb(uint8_t * buf, lv_color_t color, lv_opa_t opa)
{
lv_color_t bg_color;
lv_color_t res_color;
lv_opa_t bg_opa = buf[LV_IMG_PX_SIZE_ALPHA_BYTE - 1];
#if LV_COLOR_DEPTH == 8
bg_color.full = buf[0];
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[1]);
if(buf[1] <= LV_OPA_MIN) return;
buf[0] = res_color.full;
#elif LV_COLOR_DEPTH == 16
bg_color.full = buf[0] + (buf[1] << 8);
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[2]);
if(buf[2] <= LV_OPA_MIN) return;
buf[0] = res_color.full & 0xff;
buf[1] = res_color.full >> 8;
#elif LV_COLOR_DEPTH == 32
bg_color = *((lv_color_t *)buf);
lv_color_mix_with_alpha(bg_color, bg_opa, color, opa, &res_color, &buf[3]);
if(buf[3] <= LV_OPA_MIN) return;
buf[0] = res_color.ch.blue;
buf[1] = res_color.ch.green;
buf[2] = res_color.ch.red;
#endif
}

screenshot attached here

RohitTrustedwear_0-1729871170120.png

 

0 REPLIES 0