Open Rayvert64 opened 4 months ago
Link to #1: Basically I might need to do this ticket(The one this comment is in) in order to get the newer LVGL to Compile.
The FreeRTOS kernel seems to be much bigger than ChibiOSs. 10kB vs 1-3kB in ROM. Which makes sense, I'm pretty sure we dont need half the features of FreeRTOS. https://www.freertos.org/FAQMem.html#ROMUse https://forum.chibios.org/viewtopic.php?t=2449#p19431
At the moment, when compiling, we are going over by a few kB in size depending on the implementation of the STDLIB we use. ChibiOS has ChibiOS-HAL that we can probably use, which is known to use quite a bit less memory on STM32 chips than using the built-in STM libraries. So checking this out could be worth it as well.
For now though I am still focusing on just getting the size smaller on FreeRTOS if FreeRTOS is really too memory hungry, then I'll get started on this and make this fork its own thing.
Looking at the .map files, I noticed that there where some big AF structures in the .bss section which seemed to be the main culprit in making the binary not fit in memory. Simply changing the main so that we don't initialize displayApp
and systemTask
statically, instead I save a pointers statically and initiallise them in the main which lives for the entire duration of the runtime. Doing this I was able to save TONS of ram, that being said I am still not certain this will work as I still don't have this thing running hahaha 😅.
I know that LVGL has been used with ChibiOS, all we need to do is have expose the task apis and the mutex, semaphore structures to LVGL.
I think we could do something cool to allow for drop-in RTOSs to work, since all RTOSs use the same basics for scheduling.
I just like ChibiOS since it is modular. From the ChibiOS website: