lvgl: LV_MEM_CUSTOM: DMA Problem
🔑 Keywords: dma, usart, peripheral, stm32, LV_MEM_CUSTOM, memory leak
We use Stm32 boards with USART+DMA+Periphereal. There is an interesting memory problem.
Below minimal code fragment stops the DMA.
static lv_obj_t * lbl = NULL;
char buf[5] = "1234567"; // overflow problem!!!
lbl = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(lbl, buf);
We fixed “overflow problem” and set #define LV_MEM_CUSTOM 0
then the same behaviour/overflow arises. DMA stops.
We suspect the LV_MEM_CUSTOM produces memory leak.
Notes,
- LittlevGL v5.2
- lv_conf.h: https://gist.github.com/seyyah/f6deddd16b75ff1251887f2f7a81f145
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (16 by maintainers)
@seyyah only you can determine what is a good size for LV_MEM_SIZE. For example… in my case even 8k is more than enough. Use
lv_mem_monitor
to see how much of LV_MEM_SIZE you are using on your most strenuous menu, in the worst possible scenario. After that you can determine how large it needs to be. Better to start large and work your way down once everything else is finalized.Try to rewrite the line:
char buf[5] = "1234567"; // overflow problem!!!
by this:
const char* buf = "1234567";