-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
freetype for MCU #12
Comments
It'a certainly possible to build FreeType on MCUs but it requires some adjustments on FreeTypes build system. I moved this issue to the FreeType repo. |
As I understand it, this library is not compatible with MCUs, but it is compatible with simulators, right? |
FreeType can run on sufficiently powerful MCUs as well. I have used it on STM32 before, though not with LVGL. |
Some MCUs do not support the C File API( |
I saw some implementations on ESP32, but it's unrelated to LVGL so I can't comment much on it. |
I added freetype support to lvgl in Tasmota on Esp32. It runs fine but you need to be cautious about memory and stack size. The default 8kb stack is insufficient for freetype. I suppose similar MCUs will work with the same constraints. |
That's great! Can share some details about how did you port FreeType to ESP32? |
I agree with @kisvegabor. |
Sure, and sorry for the late response. First FreeType compiles out of the box on ESP32, so it does not require specific work here. The main problem is that calling Currently I run Here is the patched code: https://github.com/arendst/Tasmota/blob/development/lib/libesp32_lvgl/lv_lib_freetype/lv_freetype.c |
That's great, thank you for the explanation! |
I'm also looking into adding this functionality to my ESP32 project. Thanks @s-hadinger for sharing your solution!
Are you refering too Call function with external stack? |
Yes. That's the one. I will switch to this method which is simpler |
I've also made a wrapper here for someone who needs it: https://github.com/huming2207/esp-ft2 Currently:
|
Which stack do you mean? |
As per @s-hadinger mentioned, the task that eventually does |
In my experience you need 24KB of CPU native stack to have Freetype run correctly. This gives 3 options:
|
Yep. For our scenario, we can just increase the main thread's stack to be 32KB as we also have a lot of other stuff that needs the stack memory anyway. |
I think the right way of doing this is probably to spin up a FreeRTOS task with 24KB stack in the init function, that wait and deal with FT2, and pass the data over a FreeRTOS queue to the real |
This is what I did the first time, because I couldn't increase the main stack. But it's a little more complicated to do. |
Glad to use add this(LVGL+Freetype) into my ESP32 project. But my concern is the resource constraint because my project also use so much space and cpu. Can you share some info on resources usage of this Freetype? Currently, we are using ESp32-WROOM but I can use ESP32-Wrover if it's suitable. Thanks; |
Everything is explained above. You need at least 24KB of stack when calling Freetype. It's really stretched if you don't have a PSRAM. |
The "freeType" library tested in LVGL emulator is normal, can "LVGL + FreeType" add support for MCU?
The text was updated successfully, but these errors were encountered: