lv_port_pc_vscode icon indicating copy to clipboard operation
lv_port_pc_vscode copied to clipboard

Build failed when enabled USE_FREERTOS

Open CodingPapi opened this issue 11 months ago • 5 comments

Hi, When I disable USE_FREERTOS, every thing goes fine. After enable this option and set LV_USE_OS to LV_OS_FREERTOS, build failed and shows:

/usr/bin/ld: cannot find -lFreeRTOS: No such file or directory

My environment: Ubuntu gcc and clang, ld and lld both failed @MootSeeker could you plz help to check this issue?

CodingPapi avatar Dec 16 '24 08:12 CodingPapi

https://github.com/lvgl/lv_port_pc_vscode/issues/62#issuecomment-2366761778

Others also report this issue

CodingPapi avatar Dec 16 '24 08:12 CodingPapi

Same issue here.

BKDeepak-Microair avatar Dec 17 '24 06:12 BKDeepak-Microair

I have the same issue and I have a clue. "cannot find -lFreeRTOS" means that you try to link a library name "FreeRTOS" with current target, but there is no such library.

In /lv_port_pc_vscode-master/CMakeLists.txt 85: target_link_libraries(main freertos_config FreeRTOS) this sentence cause try to link FreeRTOS and cause a problem, because there is no such lib named "FreeRTOS". This lib should be generate by user self, but this project have no code to generate such lib.

In fact, you can “#” the whole line. I don't really know why but it not affect the build process.

Then try to build. You may find that there is a issue. It failed and shows: /lvgl/src/osal/lv_freertos.c:265 undefined reference to "xTaskGenericNotify"

Find /lv_port_pc_vscode-master/config/FreeRTOSConfig.h :37 #define configUSE_TASK_NOTIFICATIONS 0 change it to 1 like this #define configUSE_TASK_NOTIFICATIONS 1

Now it can generate target, but I meet a new issue: When I try to run it, it doesn't works. And debug shows that it stop at /FreeRTOS/task.c :7867 ucOriginalNotifystate = pxTCB->ucNotifyState[ uxIndexToNotify]; with a "Segmentation fault".And this line in the fanction xTaskGenericNotify

I can't deal this new issue, maybe I will open a comment later.

unrecyclable avatar Dec 20 '24 04:12 unrecyclable

Folks to enable the FreeRTOS to be used you need to enable it on the lv_conf.h but you need also to enable its linking on the CMakeLists, just set to ON this option:

https://github.com/lvgl/lv_port_pc_vscode/blob/3defb84ea5c107bedbc1c9c2222355f2fcf7330d/CMakeLists.txt#L9C1-L9C77

uLipe avatar Jan 16 '25 21:01 uLipe

I have the same issue and I have a clue. "cannot find -lFreeRTOS" means that you try to link a library name "FreeRTOS" with current target, but there is no such library.

In /lv_port_pc_vscode-master/CMakeLists.txt 85: target_link_libraries(main freertos_config FreeRTOS) this sentence cause try to link FreeRTOS and cause a problem, because there is no such lib named "FreeRTOS". This lib should be generate by user self, but this project have no code to generate such lib.

In fact, you can “#” the whole line. I don't really know why but it not affect the build process.

Then try to build. You may find that there is a issue. It failed and shows: /lvgl/src/osal/lv_freertos.c:265 undefined reference to "xTaskGenericNotify"

Find /lv_port_pc_vscode-master/config/FreeRTOSConfig.h :37 #define configUSE_TASK_NOTIFICATIONS 0 change it to 1 like this #define configUSE_TASK_NOTIFICATIONS 1

Now it can generate target, but I meet a new issue: When I try to run it, it doesn't works. And debug shows that it stop at /FreeRTOS/task.c :7867 ucOriginalNotifystate = pxTCB->ucNotifyState[ uxIndexToNotify]; with a "Segmentation fault".And this line in the fanction xTaskGenericNotify

I can't deal this new issue, maybe I will open a comment later.

I fixed this issue. I have created a pull request. It works on Ubuntu 24.10. https://github.com/lvgl/lv_port_pc_vscode/pull/73#issue-2803059815

psanyi avatar Jan 22 '25 07:01 psanyi

Hi this should be fixed after https://github.com/lvgl/lv_port_pc_vscode/pull/92 was merged. Let me know if you still encounter any issues

AndreCostaaa avatar Sep 01 '25 11:09 AndreCostaaa