Skip to content

Arduino H7 Video with LVGL memory/buffer related issues #1106

@JwX000

Description

@JwX000

Hello!
It seems that there are some issues with memory/buffer management in Arduino H7 Video when using LVGL:

  • Arduino_H7_Video::begin() allocates buf1 of size (X * Y * 1B) of lv_color_t (3B/px), where LVLG examples suggest buffer of BYTES_PER_PIXEL elements, which would lead to memory usage reduction
    'static lv_color_t * buf1 = (lv_color_t*)malloc((width() * height() / 10));'
  • but to lv_display_set_buffers() it is passed only in fragment, because size is passed as X*Y/10 not sizeof(buf1), which creates buffer of size smaller that 1/10 of display resolution (which is recommended minimal size)
    lv_display_set_buffers(display, buf1, NULL, width() * height() / 10, LV_DISPLAY_RENDER_MODE_PARTIAL);
  • trying to pass correct bigger size causes a fail on Arduino Giga, probably during screen rotation (disabling rotation allows for passing bigger /correct buffer size without fail),
  • rotation inside lvgl_displayFlushing allocates buffer of X * Y * 4 inside internal RAM, which cannot success for Giga (trying to allocate 1.5MB when internal RAM is 1MB), additionally x4 factor is probably not needed - BYTES_PER_PIXEL would suffice
    rotated_buf = (uint8_t*)realloc(rotated_buf, w * h * 4);

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions