Hi,
i developing smartwatch for my graduation project, developed a analog clock for the sleeping mode but, i have a problem on memory, i wrote before to the forum but, lv_mem_alloc() function give a error, how can i solve my problem ?
i saw this method at a websites; lv_color_t *cbuf = (lv_color_t*)lv_mem_alloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR(272, 272));
Hi, you can use several methods like this
1.modify more large size => LV_MEM_SIZE (@lv_conf.h)
2.use static buffer => static lv_color_t color_buffer[…]
3.use malloc(…) (system memory is large enough, usually apply in simulation mode)
Thank you, i tried to first method. LV_MEM_SIZE changed and similation work now. But i have a question, how can i calculate the alloc memory? can you give a advice? # define LV_MEM_SIZE (32U * 32768U)
I suggest using lv_mem_monitor and determining how much memory is used. Increase that value a bit (for safety) and you have what you actually need for your application.
İ tried to compiling for stm32f7 disco on cube ide but ide again giving this error; .bss' will not fit in region RAM’,
please can you answer on a video tutorial?
c:\st\stm32cubeide_1.0.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: stm32f746_disco_no_os.elf section .bss' will not fit in region RAM’
c:\st\stm32cubeide_1.0.1\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: region `RAM’ overflowed by 81856 bytes
This my memory size; # define LV_MEM_SIZE (32U * 12000U)
and this my code for canvas buffer; lv_color_t *cbuf = (lv_color_t*)lv_mem_alloc(LV_CANVAS_BUF_SIZE_ALPHA_2BIT(272, 272));
i thinked change from LV_CANVAS_BUF_SIZE_TRUE_COLOR to LV_CANVAS_BUF_SIZE_ALPHA_2BIT, but my problem isnt solved, please help me !
i m working on this problem for 4 weeks and i dont get an answer to a great solution.
i tested simulation on visual studio, if memory size small from 32U * 12000U, returned error code, but memory alloc is bigger from 32U * 12000 then simulation working. i tried on cube ide and i debuged if memory alloc is smaller, ide can doing debug but send program to stm32f7 disco, drawing does not appear on the screen.İf memory alloc is bigger 32U * 12000U then cube ide dosnt compile, return error code.
This is completely normal, because the DISCO board has a lot less RAM than the simulator does.
Do you need to use the canvas to draw the watch face, or can you just create one or more custom objects? The canvas is very inefficient for this use case because you have to store the whole rendered object as a bitmap in memory, whereas a true LittlevGL object requires far less RAM.
I gave up the canvas, now i m developing a object for analogue dial, i get lmeter for reference object. Now i draw my dial on Visual studio simulation;
but take errors to lvgl objects in now on cube ide.
This is page create module;
This means that there’s a typo in one of the header files being included by lv_bar.h. The C compiler doesn’t always give you exact error readings so you need to do some investigation yourself.
i finded the real problem, i wasn’t think before, so visual studio definitions is different to cube ide definitions. And another problem i import lvgl in my object, but i include in screen library at same time.
the picture from my static clock dial
I have a working watch now :), but dont understand, why pixels gets broken in image? and why the screen feels slow? so, lvgl demo application was so fast. How can solution for pixels and speed?