Unable to refer to functions in lv_qrcode.h from Zephyr

Hey folks,
I am trying to use the lv_qrcode library with my Zephyr Nordic nRFConnect project.
I keep getting CMake build errors such as below when I try access functions from lv_qrcode.h in my application.
In function ‘qrcode_scr_lvgl_create’: [build] /workspaces/app_nrf_fw/src/graphic_manager/qrcode_screen.c:87:9: error: implicit declaration of function ‘lv_qrcode_create’; did you mean ‘lv_group_create’? [-Werror=implicit-function-declaration] [build] 87 | lv_qrcode_create( qrcode_screen, QRCODE_DIMENSION_PIXELS, lv_color_hex3( LV_COLOR_HEX3_DARKEST ), lv_color_hex3( LV_COLOR_HEX3_LIGHTEST ) ); [build] | ^~~~~~~~~~~~~~~~ [build] | lv_group_create [build] /workspaces/app_nrf_fw/src/graphic_manager/qrcode_screen.c:86:12: error: assignment to ‘lv_obj_t *’ {aka ‘struct _lv_obj_t *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] [build] 86 | qr_obj = [build] | ^
And this is in my prj.conf
# LVGL
CONFIG_LVGL=y
CONFIG_LV_CONF_MINIMAL=y
CONFIG_LV_Z_BITS_PER_PIXEL=1
CONFIG_LV_Z_VDB_SIZE=100
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_Z_MEM_POOL_NUMBER_BLOCKS=3
CONFIG_LV_COLOR_DEPTH_1=y
CONFIG_LV_USE_LABEL=y
CONFIG_LV_USE_IMG=y
CONFIG_LV_USE_QRCODE=y C
ONFIG_LV_USE_CANVAS=y
I also see this line in my build log:
 [build] [265/448 58% :: 2.346] Building C object modules/lvgl/CMakeFiles/modules__lvgl.dir/workdir/nrfconnect/modules/lib/gui/lvgl/src/extra/libs/qrcode/lv_qrcode.c.o
Any and all tips would be appreciated! Thank you

Parents
  • Hi Alen,

    Thank you for contacting DevZone at NordicSemi.

    I cannot see the CmakeLists file you have attached.

    Nonetheless, I just copied the project configs you have pasted here.

    I started with the LVGL sample in NCS 2.5.0, added your configs to the prj.conf,

    and then modified the main.c to use the function you have mentioned. 

    I was able to compile it well. I built it for the nrf52840dk_nrf52840 with the AdaFruit 2.8 inch shield.

    Just attaching the complete zip for reference. 

    lvgl.rar

    With regards,

    Naeem

  • Hey  I will give that a try, in the meantime this is my CMakeLists.txt

    add_library(graphic_manager STATIC)
    add_library(app::graphic_manager ALIAS graphic_manager)
    
    target_sources(graphic_manager
        PRIVATE
        include/graphic_manager.h
        include/intro_screen.h
        include/qrcode_screen.h
        include/default_screen.h
    
        graphic_manager.c
        intro_screen.c
        qrcode_screen.c
        default_screen.c
    )
    FILE(GLOB font_sources assets/fonts/*.c)
    target_sources(app PRIVATE ${font_sources})
    
    FILE(GLOB img_sources assets/images/*.c)
    target_sources(app PRIVATE ${img_sources})
    
    target_include_directories(graphic_manager
        PUBLIC
        include
        PRIVATE
    
        ${ZEPHYR_BASE}/../modules/lib/gui/lvgl
        ${ZEPHYR_BASE}/modules/lvgl
    )
    
    target_compile_options(graphic_manager
        PRIVATE
    )
    
    target_link_libraries(graphic_manager
        PUBLIC
        app::config
        app::blackboard
        app::event_manager
        zephyr
    )
    

Reply
  • Hey  I will give that a try, in the meantime this is my CMakeLists.txt

    add_library(graphic_manager STATIC)
    add_library(app::graphic_manager ALIAS graphic_manager)
    
    target_sources(graphic_manager
        PRIVATE
        include/graphic_manager.h
        include/intro_screen.h
        include/qrcode_screen.h
        include/default_screen.h
    
        graphic_manager.c
        intro_screen.c
        qrcode_screen.c
        default_screen.c
    )
    FILE(GLOB font_sources assets/fonts/*.c)
    target_sources(app PRIVATE ${font_sources})
    
    FILE(GLOB img_sources assets/images/*.c)
    target_sources(app PRIVATE ${img_sources})
    
    target_include_directories(graphic_manager
        PUBLIC
        include
        PRIVATE
    
        ${ZEPHYR_BASE}/../modules/lib/gui/lvgl
        ${ZEPHYR_BASE}/modules/lvgl
    )
    
    target_compile_options(graphic_manager
        PRIVATE
    )
    
    target_link_libraries(graphic_manager
        PUBLIC
        app::config
        app::blackboard
        app::event_manager
        zephyr
    )
    

Children
No Data
Related