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

esp32 s3 box 使用lvgl v8.3 的rlottie库会出现这个c++编译器问题。需要怎么解决? (AEGHB-583) #136

Closed
huangdiajd opened this issue Mar 6, 2024 · 13 comments

Comments

@huangdiajd
Copy link

[1490/1492] Linking CXX executable rlottie.elf
FAILED: rlottie.elf
cmd.exe /C "cd . && F:\ESP-IDF\440\tools\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin\xtensa-esp32s3-elf-g++.exe -mlongcalls @CMakeFiles\rlottie.elf.rsp -o rlotti
e.elf && cd ."
f:/esp-idf/440/tools/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: f:/esp-idf/440/too
ls/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/lib/no-rtti\libstdc++.a(thread.o):(.literal._ZNS
t6thread20hardware_concurrencyEv+0x0): undefined reference to sysconf' f:/esp-idf/440/tools/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: f:/esp-idf/440/too ls/tools/xtensa-esp32s3-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/lib/no-rtti\libstdc++.a(thread.o): in function
std::thread::hardware_concurrency()':
/builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/gcc/libstdc++-v3/src/c++11/thread.cc:177: undefined reference to `sysconf'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

这个应改怎么解决c++编译器链接不到的问题?

@github-actions github-actions bot changed the title esp32 s3 box 使用lvgl v8.3 的rlottie库会出现这个c++编译器问题。需要怎么解决? esp32 s3 box 使用lvgl v8.3 的rlottie库会出现这个c++编译器问题。需要怎么解决? (AEGHB-583) Mar 6, 2024
@LHYhorion
Copy link

根据 log 判断,建议更新下子模块,如果是使用的 Linux, 直接在目录下使用 git submodule update --init --recursive。或者您可以尝试更新 IDF 版本以测试是否还会出现链接错误的情况。

@huangdiajd
Copy link
Author

根据 log 判断,建议更新下子模块,如果是使用的 Linux, 直接在目录下使用 git submodule update --init --recursive。或者您可以尝试更新 IDF 版本以测试是否还会出现链接错误的情况。

这个链接错误,只有第一次构建项目是可以编译成功的,但是第二次编译就不行,就需要我将所以的配置文件删除掉,重新编译才可以。我目前使用的idf 是v4.4版本,我有试过在5.1版本上面运行rlottie,但是看起来似乎是5.1的编译器更加不支持rlottie。您有其他更好的办法解决这个链接问题吗?

@LHYhorion
Copy link

LHYhorion commented Mar 6, 2024

您可以尝试使用该库 https://github.com/LHYhorion/lvgl_lottie_example 这个仓库演示了如何使用 LVGL +rlottie。

@huangdiajd
Copy link
Author

[Error: non zero exit code 2 Adding "set-target"'s dependency "fullclean" to list of commands with default set of options. Executing action: fullclean Build directory 'C:\Users\Administrator.SKY-20231130ZEF\Desktop\lvgl_lottie_example-master\build' not found. Nothing to clean. Executing action: set-target Set Target to: esp32s3, new sdkconfig will be created. Running cmake in directory C:\Users\Administrator.SKY-20231130ZEF\Desktop\lvgl_lottie_example-master\build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=f:\ESP-IDF\510\tools\python_env\idf5.1_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=0 C:\Users\Administrator.SKY-20231130ZEF\Desktop\lvgl_lottie_example-master"... -- Found Git: F:/Git/install/Git/cmd/git.exe (found version "2.42.0.windows.2") ###232232C:/Users/Administrator.SKY-20231130ZEF/Desktop/lvgl_lottie_example-master/components -- The C compiler identification is GNU 12.2.0 -- The CXX compiler identification...
我构建项目,是没法通过的

@huangdiajd
Copy link
Author

0594c125a3b757b857eb3fdb03c9b7c
您好,您给我的这个项目我也是成功编译过一次,然后重新编译项目就会出现c++链接问题了,我要如何解决rlottie c++链接问题,才能让他做到兼容rlottie库?

@LHYhorion
Copy link

因为我这边编译不会出现你这种情况,所以可以确定 IDF 环境是没问题的,而你的项目成功编译过一次就出现问题,很可能是第一次编译某些配置发生了重定向的情况,或者是残留文件导致链接错误。因为我这边没法复现所以不好排查,建议还是检查一下编译环境或者清一下缓存再编。

@LHYhorion
Copy link

建议重点检查 sysconf 的相关环境变量,第二次编译时可能由于环境变量发生了变化或者缺少必要的环境变量,导致链接错误。您需要确保环境变量的设置在两次编译中保持一致。

@huangdiajd
Copy link
Author

建议重点检查 sysconf 的相关环境变量,第二次编译时可能由于环境变量发生了变化或者缺少必要的环境变量,导致链接错误。您需要确保环境变量的设置在两次编译中保持一致。

这个环境我这儿确实是出现在menuconfig上面了,但是我也查出来是那个配置发生了变化。不过目前是可以解决。我现在遇到一个问题就是播放一次动画之后,我要怎么清除这个最后一帧动画图像呢?

@LHYhorion
Copy link

如果您是将解析的 img 赋值到一个画布上,您可以尝试直接将组件清除掉。或者可以尝试取到 lottie 值,将 data 强制清空掉。

@huangdiajd
Copy link
Author

如果您是将解析的 img 赋值到一个画布上,您可以尝试直接将组件清除掉。或者可以尝试取到 lottie 值,将 data 强制清空掉。

您好,我现在问题是解决了。我是通过创建lvgl的定时器实现对当前帧的计算,然后调用事件组来删除rlottie组件。我不太清除这样使用影不影响使用,但是看起来还算可以。目前是使用您提供的esp32 S3 box 的程序,我在我实现开关机时候遇到一个E (16191) spi: spi_bus_initialize(756): SPI bus already initialized. 问题,对于程序的关机功能 我的反初始化应该怎么调用函数。我现在看不到spi反初始化函数的实现是在那个位置?下面是我的反初始化函数的实现是有错误的
void bsp_display_end(void)
{
lvgl_port_deinit();
//spi_bus_remove_device();
// spi_bus_free(BSP_LCD_SPI_NUM);

lv_disp_t* disp = bsp_display_start();

lvgl_port_remove_disp(disp);

}

@LHYhorion
Copy link

@huangdiajd
Copy link
Author

您可以参考其中的反初始化步骤 https://github.com/espressif/esp-iot-solution/blob/master/components/display/lcd/esp_lcd_st77922/test_apps/main/test_esp_lcd_st77922.c

您好,我现在又遇到新的问题。就是我想实现 在任务里面循环播放rlottie动图,但是他是一直会出现看门狗复位。后面我进行喂狗,也是没能解决这个问题。我应该怎么避免这个问题的出现。下面是我的代码部分,您有什么好的思路可以参考一下吗?
void task_wait(void *param)
{
bsp_display_lock(0);
lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_scr_act(), 120, 180, (const void *)toast);
lv_obj_center(lottie);
bsp_display_unlock();
while(1)
{

    // lv_rlottie_set_play_mode(lottie,LV_RLOTTIE_CTRL_PLAY);
    esp_task_wdt_reset();
    ESP_LOGI(TAG,"esp_task_wdt_reset");
    vTaskDelay(1000/portTICK_PERIOD_MS);

}
// timer_wait = lv_timer_create(my_timer_wait, 500, lottie);

// lv_obj_del(lottie);
vTaskDelete(NULL);

}

@LHYhorion
Copy link

您可以尝试将 Freertos_hz 改为 1000,并且尝试调整 lvgl 相关配置,如: priority、sleep_ms、perid。观察是否可避免看门狗问题,同时建议把相关配置调整到最高,可以参考:#134 (comment)

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

2 participants