Skip to content

MCUboot with LVGL MIMXRT1160_EVK causes incredible lag #75702

@RafalHalik

Description

@RafalHalik

Describe the bug
I've been working with the LVGL sample in zephyr for the 1160, touch screen did need to be looked at but that's solved now. However when I decided to flash MCUboot onto the device and then load into my very basic LVGL app it seems to slow down considerably. On the screen I have a button, arc slider, btn matrix and an animation example from LVGL docs webpage. The animation is just to visually perceive the lag as the fps counter from LVGL is stuck at 33fps even though you can clearly see its much lower.

So far from my testing I've concluded that the LVGL app just as a bin flashed on works with no problems its responsive and the UART console is also responsive. Where as when a vanilla MCUboot built for mimxrt1160 is flashed onto the device then the signed image flashed, it seems to slow down to a crawl and this is not just the graphics but the UART console too. So its not just a lvgl_flush_thread issue of it being cpu starved but the whole app.

Currently I've only really noticed one difference between the regular app and the MCUboot loaded app. This being another 2 devices on the board SPI bus and a child node on the spi bus. Not sure if this is the cause of the lag but thought I'd mention it
image

Touch screen help
link to helpful issue page for anyone also struggling with touch screen: (#75178 (comment))

Please also mention any information which could help others to understand
the problem you're facing:

  • Devices: MIMXRT1160_evk with rk055hdmipi4ma0 display
  • Currently no work around for this issue
  • With touch disabled the issue is this prevalent

Side note: I was also looking into enabling VG_Lite to see if this helped but was not able to get the includes resolved seems to be missing the files completely in zephyr?

To Reproduce
Steps to reproduce the behavior:

  1. build mcuboot and flash

    • west build -b mimxrt1160_evk/mimxrt1166/cm7
    • west flash
  2. build lvgl sample and flash

    • west build -b mimxrt1160_evk/mimxrt1166/cm7 --pristine -- -DSHIELD=rk055hdmipi4ma0
    • west sign -t imgtool -d build --no-hex -- --version 1.0.0 --pad --key /workdir/bootloader/mcuboot/root-rsa-2048.pem
    • west flash -f build/zephyr/zephyr.signed.bin
  3. Open putty terminal or minicom to observe UART lag also display for lag.

Expected behaviour
App will load and start however this will take a while and the app with also be very slow.

Impact
Because of this developing using MCUboot and LVGL for the graphics library is no feasible as even with a basic app its far to slow to be useful. So a showstopper.

Extra code for animation

  static void anim_x_cb(void * var, int32_t v)
  {
      lv_obj_set_x(var, v);
  }

  static void anim_size_cb(void * var, int32_t v)
  {
      lv_obj_set_size(var, v, v);
  }

  void lv_example_anim_2(void)
  {
    lv_obj_t * obj = lv_obj_create(lv_scr_act());
    lv_obj_set_style_bg_color(obj, lv_palette_main(LV_PALETTE_RED), 0);
    lv_obj_set_style_radius(obj, LV_RADIUS_CIRCLE, 0);

    lv_obj_align(obj, LV_ALIGN_LEFT_MID, 10, 100);

   lv_anim_t a;
   lv_anim_init(&a);
   lv_anim_set_var(&a, obj);
   lv_anim_set_values(&a, 10, 50);
   lv_anim_set_time(&a, 1000);
   lv_anim_set_playback_delay(&a, 100);
   lv_anim_set_playback_time(&a, 300);
   lv_anim_set_repeat_delay(&a, 500);
   lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
   lv_anim_set_path_cb(&a, lv_anim_path_ease_in_out);

   lv_anim_set_exec_cb(&a, anim_size_cb);
   lv_anim_start(&a);
   lv_anim_set_exec_cb(&a, anim_x_cb);
   lv_anim_set_values(&a, 10, 240);
   lv_anim_start(&a);
   }       

prj.conf file for my lvgl project

 CONFIG_MAIN_STACK_SIZE=2048
 CONFIG_DISPLAY=y
 CONFIG_DISPLAY_LOG_LEVEL_ERR=y     
 CONFIG_UART_CONSOLE=y
 CONFIG_UART_INTERRUPT_DRIVEN=y
 CONFIG_GPIO=y
 CONFIG_INPUT_GT911=y
 CONFIG_INPUT_GT911_INTERRUPT=n
 CONFIG_INPUT=y
 CONFIG_SERIAL=y
 CONFIG_LOG=y
 CONFIG_SHELL=y
 CONFIG_DMA=y
 CONFIG_MCUX_ELCDIF_PXP=y
 CONFIG_I2C=y
 CONFIG_I2C_SHELL=y
 CONFIG_LVGL=y
 CONFIG_LV_Z_MEM_POOL_SIZE=56384
 CONFIG_LV_Z_SHELL=y
 CONFIG_LV_USE_PERF_MONITOR=y
 CONFIG_LV_MEM_CUSTOM=y
 CONFIG_LV_USE_LOG=y
 CONFIG_LV_USE_LABEL=y
 CONFIG_LV_USE_BTN=y
 CONFIG_LV_USE_ARC=y
 CONFIG_LV_USE_IMG=y
 CONFIG_LV_USE_GPU_NXP_PXP=n
 CONFIG_LV_FONT_MONTSERRAT_14=y
 CONFIG_LV_USE_GPU_NXP_VG_LITE=n
 CONFIG_LV_Z_POINTER_INPUT=y
 CONFIG_BOOTLOADER_MCUBOOT=y

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK

Metadata

Metadata

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions