Skip to content
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

after enabling the rtos part of this project select in lv_conf.h (#define LV_USE_OS LV_OS_NONE to #define LV_USE_OS LV_OS_FREERTOS) #62

Open
viys opened this issue Sep 14, 2024 · 23 comments

Comments

@viys
Copy link

viys commented Sep 14, 2024

ubunu 24.04
image
I have tried many times but couldn't solve this issue. During this process, I created an Ubuntu virtual machine as well as WSL2 on Windows.

@MootSeeker
Copy link
Contributor

@viys did you followed the instruction?
Could you describe how you setup the project?

@viys
Copy link
Author

viys commented Sep 22, 2024

Recently, I noticed that you have made updates, but I encountered the following issues while compiling the project.
Here is the process of my setup project,
29a7fd0fe0f0a620658c01d750a3394
20240922201955
20240922202040
I won't be able to complete the compilation of the project this time.

@kisvegabor
Copy link
Member

Probably it's related to this: #65 (comment)

@MootSeeker
Copy link
Contributor

@viys Did you checked the CMake path, is it right?

@viys
Copy link
Author

viys commented Sep 25, 2024

@viys Did you checked the CMake path, is it right?

I directly cloned from the repository, modified it, and followed “To enable the rtos part of this project select in lv_conf.h #define LV_USE_OS LV_OS_NONE to #define LV_USE_OS LV_OS_FREERTOS. Additionally, you have to enable the compilation of all FreeRTOS files by turning on option(USE_FREERTOS "Enable FreeRTOS" OFF) in the CMakeLists.txt file.” to make the changes.😢

@ombluetuneAI
Copy link

@viys Did you checked the CMake path, is it right?

I directly cloned from the repository, modified it, and followed “To enable the rtos part of this project select in lv_conf.h #define LV_USE_OS LV_OS_NONE to #define LV_USE_OS LV_OS_FREERTOS. Additionally, you have to enable the compilation of all FreeRTOS files by turning on option(USE_FREERTOS "Enable FreeRTOS" OFF) in the CMakeLists.txt file.” to make the changes.😢

I have the same error as you, and has it been resolved?

@AndyEveritt
Copy link

I have the same issue with the segfault. The debugger gives this backtrace

xTaskGenericNotify(TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t * pulPreviousNotificationValue) (.\lv_port_pc_vscode\FreeRTOS\tasks.c:7867)
lv_thread_sync_signal(lv_thread_sync_t * pxCond) (.\lv_port_pc_vscode\lvgl\src\osal\lv_freertos.c:265)
lv_draw_dispatch_request() (.\lv_port_pc_vscode\lvgl\src\draw\lv_draw.c:278)
execute_drawing_unit(lv_draw_sw_unit_t * u) (.\lv_port_pc_vscode\lvgl\src\draw\sw\lv_draw_sw.c:251)
render_thread_cb(void * ptr) (.\lv_port_pc_vscode\lvgl\src\draw\sw\lv_draw_sw.c:352)
prvRunThread(void * pxArg) (.\lv_port_pc_vscode\lvgl\src\osal\lv_freertos.c:330)
prvWaitForStart(void * pvParams) (.\lv_port_pc_vscode\FreeRTOS\portable\ThirdParty\GCC\Posix\port.c:480)
libc.so.6!start_thread(void * arg) (pthread_create.c:442)
libc.so.6!clone3() (clone3.S:81)

The xTaskToNotify variable is null which is causing the segfault

@AndyEveritt
Copy link

Updating the lvgl and freertos submodules to release/v9.2 and main (974351fe4aec19779f5be774007810c6ab36a8ab) respectively fixes the segfault

@kisvegabor
Copy link
Member

@liamHowatt @uLipe could you take a look at this issue?

@uLipe
Copy link
Member

uLipe commented Dec 18, 2024

Looks like the render thread was not created when the sw render executor wants to trigger it.

I will check that

@AndyEveritt
Copy link

@uLipe did you find a solution in the end?

@uLipe
Copy link
Member

uLipe commented Jan 16, 2025

@AndyEveritt this is on my next tasks to handle, I will keep you posted.

@psanyi
Copy link

psanyi commented Jan 30, 2025

PR #73 fixes this issue

@MarcoGit82
Copy link

MarcoGit82 commented Jan 31, 2025

@psanyi thanks for your PR. It solved the initial issue I was having, too.
I'm facing another problem, though.

When initing the SDL drivers within the lvgl_task context, it seems to get lost here:

Image

The lvgl_task doesn't recover from there and it cannot be paused for debuggin.
The other task is running and printing out stuff.

If I switch back to LV_OS_NONE the example works with the same SDL drivers.

Any advise on this?

Thanks.

@psanyi
Copy link

psanyi commented Jan 31, 2025

@psanyi thanks for your PR. It solved the initial issue I was having, too. I'm facing another problem, though.

When initing the SDL drivers within the lvgl_task context, it seems to get lost here:

Image

The lvgl_task doesn't recover from there and it cannot be paused for debuggin. The other task is running and printing out stuff.

If I switch back to LV_OS_NONE the example works with the same SDL drivers.

Any advise on this?

Thanks.

Try to increase the stack size of lvgl task.
if (xTaskCreate(lvgl_task, "LVGL Task", 4096, nullptr, 3, nullptr) != pdPASS) {
printf("Error creating LVGL task\n");
/* Error handling */
}

@MarcoGit82
Copy link

Thanks for reply, but already tried that.

@psanyi
Copy link

psanyi commented Jan 31, 2025

What kind of OS you are using?
I tried on Ubuntu and Linux Mint. It worked well with stock SDL library installed.

Make sure in your config/FreeRTOSConfig.h
configUSE_TASK_NOTIFICATIONS is set to 1

Make sure the lvgl and the other task priorities is not less then 3.
if (xTaskCreate(lvgl_task, "LVGL Task", 4096, nullptr, 3, nullptr) != pdPASS) {
...
}

@MarcoGit82
Copy link

I'm on Ubuntu 22.04 running on a VM hosted on Windows 11.

configUSE_TASK_NOTIFICATIONS is set to 1 and also priorities are 3, as in your PR.

I tried both stock SDL library and also tried to update that. No changes...

Also started again from scratch by cloning again the LVGL simulator. Same result.

I'll continue digging... I may need to update something on my system.

@psanyi
Copy link

psanyi commented Jan 31, 2025

I will try also in a Linux VM. Until the PR is reviewed and accepted please checkout my devel branch here
https://github.com/psanyi/lv_port_pc_vscode/tree/devel

Or you can cherry pick my PR

@psanyi
Copy link

psanyi commented Jan 31, 2025

By me at first crashed with 4096 on VM. So. It works fine with 12096. You always have to adapt the stack according to the design.
Maybe it is possible to tweak other LVGL configuration for less. GUI applications are memory hungry

if (xTaskCreate(lvgl_task, "LVGL Task", 12096, nullptr, 3, nullptr) != pdPASS) {
printf("Error creating LVGL task\n");
/* Error handling */
}

Image

@MarcoGit82
Copy link

I checked out your branch, also. No way... xD

Same behaviour. I had already tried to increase the stack size. Program Counter doesn't pass this line...

Image

While, if I switch off FreeRTOS, the demo widgets work, so SDL is doing its job...

@MarcoGit82
Copy link

A little progress... I changed my VM settings for video memory. First, it was set so that the whole available memory was usable for video. I reduced that and now LVGL can render the window, but after some seconds everything hangs, the other task, too.

Image

Regards.

@MarcoGit82
Copy link

MarcoGit82 commented Feb 3, 2025

I found a temporary workaround...

I'm managing FreeRTOS myself:

  • I set LV_USE_OS to LV_OS_NONE
  • I maunally included FreeRTOS headers in freertos_main.cpp module

Now it seems I get it working. So I think there is something in LVGL freertos configuration that conflicts with my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants