Closed C47D closed 5 years ago
Well, i think i found the root cause, i changed the line
# define LV_MEM_SIZE (64U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
to:
# define LV_MEM_SIZE (32U * 1024U) /*Size memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
Is this the 'right' way to solve it?
@C47D That error is not referring to your flash, it's saying that there's too much RAM usage. Try making your VDB size 10 * LV_HOR_RES
. I'm picking that because it's usually what causes the extra RAM.
EDIT: If you only have 64KB of RAM total, then you definitely need to reduce LV_MEM_SIZE
!
Thanks for the quick reply @embeddedt,
Thanks for the confirmation, reducing LV_MEM_SIZE
to (30 * 1024)
indeed reduce the Flash and SRAM consumption (Flash: 7.8%, SRAM: 56.3%). Setting LV_VDB_SIZE
to LV_HOR_RES * 10
increase it just by a little bit (Flash: 7.8%, SRAM: 56.9%).
I need to get more familiar to lvgl 👍
Regards, Carlos
@C47D Once you've built your application you can adjust LV_MEM_SIZE
to make it more accurate for your needs. Or if your platform already has a heap system you can use that by enabling LV_MEM_CUSTOM
.
@embeddedt Thanks, i was about to ask you about more ways to save memory within the library but you are right, that should be done at the end of the development. Should i close this issue? The main question was (quickly) solved :).
@C47D If the main issue is solved usually we recommend that you close the issue and open a new one if you have another question.
One way to easily cut down on memory usage is to try and re-use your graphical objects instead of creating many. This reduces the amount of heap space you need in total.
One way to easily cut down on memory usage is to try and re-use your graphical objects instead of creating many. This reduces the amount of heap space you need in total.
Thanks for the tip, i will try it out.
Hi,
I'm trying to make lvgl v5.3 run in my microcontroller (PSoC CY8C5888LTI-LP097, Flash: 256kB, SRAM: 64kB, Stack size: 0x600, Heap size: 0x80), i do want to use it with OLED SSD1306 128*64.
This is my lv_conf.h file:
I'm trying to enable the bare minimum lvgl functionality (monospace font and labels) but i'm getting the following compiler error:
It's the first time i get this kind of error and tried reducing the heap size to solve it without success, i must be doing something silly as i think lvgl can fit on my mcu flash without trouble, but it is not, does anybody sees any error on my conf file?
I haven't added any application code tho.
Regards,