arduino / arduino/ArduinoCore-mbed

Arduino H7 Video with LVGL memory/buffer related issues

Open
#1,106 8 comments 0 reactions 1 assignee Claimed by @leonardocavagnis View on GitHub
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

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);`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.