【已解决】TCS600u tuyaos开发怎么把提供的lvgl库编译进去

Lte-Cat.1/Cat.4/Cat.M设备,NB-IoT设备等
Post Reply
leslieli
Posts: 138

tcs600u的lvgl的库 在编译的时候 如何编译进去

东皇007
Posts: 50

Re: TCS600u tuyaos开发怎么把提供的lvgl库编译进去

1:把littlevgl拷贝到hello目录下。
2:littlevgl里的CMakelists修改:
configure_file(include/lv_gui_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/lv_gui_config.h)

function(add_app_libraries)
get_property(app_libraries GLOBAL PROPERTY app_libraries)
set_property(GLOBAL PROPERTY app_libraries ${app_libraries} ${ARGN})
endfunction()
set(target lvgl)
add_app_libraries($<TARGET_FILE:${target}>)

add_library(${target} STATIC ${dummy_c_file})
set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_LVGL)
target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_SRC_DIR} lvgl include)
这行删除 target_include_targets(${target} PRIVATE hal kernel driver)
...
省略
...

下面代码需要根据tuya_cat1_dev_lcd.h中实现。变意思时候可以去掉。先把库编译出来

if(CONFIG_SOC_8910)
target_sources(${target} PRIVATE
lv_port/lv_gui_main.c
lv_port/lv_gui_example1.c
)
endif()

3:在hello的主CMakelists.txt里增加littlevgl
if(CONFIG_APPIMG_LOAD_FLASH)
add_compile_options(-DAPP_NAME="${APP_NAME}" -DAPP_VERSION="${APP_VERSION}")
#增加littlevgl编译目录
ADD_SUBDIRECTORY(littlevgl)
set(target ${APP_NAME}${APP_VERSION})
add_appimg(${target} ${flash_ldscript} hello_world.c device_cloud.c)
target_link_libraries(${target} PRIVATE ${libtuyaos_file_name} ${libm_file_name} ${libc_file_name} ${libgcc_file_name})
set(prepack_cpio ${out_hex_dir}/${target}
prepack.cpio)
....

leslieli
Posts: 138

Re: TCS600u tuyaos开发怎么把提供的lvgl库编译进去

东皇007 2023年 Mar 3日 16:27

1:把littlevgl拷贝到hello目录下。
2:littlevgl里的CMakelists修改:
configure_file(include/lv_gui_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/lv_gui_config.h)

function(add_app_libraries)
get_property(app_libraries GLOBAL PROPERTY app_libraries)
set_property(GLOBAL PROPERTY app_libraries ${app_libraries} ${ARGN})
endfunction()
set(target lvgl)
add_app_libraries($<TARGET_FILE:${target}>)

add_library(${target} STATIC ${dummy_c_file})
set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_LVGL)
target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_SRC_DIR} lvgl include)
这行删除 target_include_targets(${target} PRIVATE hal kernel driver)
...
省略
...

下面代码需要根据tuya_cat1_dev_lcd.h中实现。变意思时候可以去掉。先把库编译出来

if(CONFIG_SOC_8910)
target_sources(${target} PRIVATE
lv_port/lv_gui_main.c
lv_port/lv_gui_example1.c
)
endif()

3:在hello的主CMakelists.txt里增加littlevgl
if(CONFIG_APPIMG_LOAD_FLASH)
add_compile_options(-DAPP_NAME="${APP_NAME}" -DAPP_VERSION="${APP_VERSION}")
#增加littlevgl编译目录
ADD_SUBDIRECTORY(littlevgl)
set(target ${APP_NAME}${APP_VERSION})
add_appimg(${target} ${flash_ldscript} hello_world.c device_cloud.c)
target_link_libraries(${target} PRIVATE ${libtuyaos_file_name} ${libm_file_name} ${libc_file_name} ${libgcc_file_name})
set(prepack_cpio ${out_hex_dir}/${target}
prepack.cpio)
....

好的谢谢我先试试

Post Reply