Why doesn't the build include driver files?

Followed the instructions for Zephyr workspace application.

the structure follows the example-application and video "tutorial: mastering Zephyr Driver Development" by Gerald Paretas.

at the file search stage, the cmake function message() shows that it goes into the driver folder.

But the application builds successfully only when this driver file is copied to \zephyrproject\zephyr\drivers\display
and add the line to the CMakeLists.txt file, which is located in this folder:
zephyr_library_sources_ifdef(CONFIG_ILI9486 display_ili9486.c).

I'm using windows 11, zephyr-v3.5.0-3682-gd7af6f371034

I'm going through the Getting Started Guide completely.
Applications are located in Zephyr workspace.
Simple examples are built successfully.
But if it’s a little more complicated, then errors appear inside Zephyr.

So, the Example application builds with errors out of the box. To avoid errors, I need to specify additional Kconfig parameters. (Case ID: 320177)

5707.test-origin-tft.zip

  • 1. The url-base must be the base of your repository, for instance https://github.com/my_user/my_newly_created_repository 

    This means that you will need to create a github-user and a repository to make this work.

    Right now, you're building an application that is a T3 type application, where the application is freestanding. This means that you will get a new clone of zephyr/ncs when initializing your application.

    We have closed the circle.

    Does this mean that two simple things don't work?

    I tried doing a clean install but was unable to remove the "nRF Connect for Desktop" on Win10.

    After installing it on a fresh system, I could not build the example from the video zds-2022-drivers-app, that the documentation refers to that it is good.

    I couldn't build my example with ili9486.

    I returned to my previous lvgl & ili9488 example, previously successfully build, but received an error.

    CMake Warning at C:/ncs/v2.5.1/zephyr/CMakeLists.txt:893 (message):
    No SOURCES given to Zephyr library: drivers__display

    I get an error on a fresh installation using the lvgl example.

    C:/ncs/v2.5.1/zephyr/include/zephyr/linker/linker-defs.h:26:10: fatal error: offsets.h: No such file or directory
    26 | #include <offsets.h>
    | ^~~~~~~~~~~

    Zephyr doesn't want to be friends with me.

    I understand that most likely I have a problem with the west.yml, but I cannot pinpoint exactly where it is.

    Comparing the volume of documentation for T1 and T2 and what is written about T3, can I believe about successful builds of T3?
    I asked on reddit, discord, circuitdojo, here but I didn’t get an answer from anyone.

    Thank you, Håkon

  • I compared Kconfig for three applications that said it worked for them with mine.

    These applications, they are on git, I could not build due to various errors.

    This magic is hidden somewhere in the depths of Zephyr.

    I went through all the points several times
    developer.nordicsemi.com/.../troubleshooting.html

    Not successful.

    Something depends on the settings of the west and the paths inside the Zephyr.

    This applies to applications based on the T3 topology.

    Simple examples are built without problems, from any folder.

    Here developer.nordicsemi.com/.../install_ncs.html

    the instruction is missing that you need to go one level below.

    Navigate to the ncs directory and run the following command in a terminal window:
    zephyr/zephyr-env.cmd

  • Hi,

     

    Just an FYI:

    Previously you were using upstream zephyr, and now you are pointing towards ncs v2.5.1, and there might have been a diff. in the samples/subsys/display/lvgl between those two tagged zephyr versions.

     

    Could you share your latest .zip file?

     

    Kind regards,

    Håkon

  • In the file prj.conf, see the comment above the line “CONFIG_DISPLAY=y”, it says about the current error.

    It doesn’t use drivers from the application, I need to copy these drivers to Zephyr so that the application can be built without errors..

    testlcd.zip

  • Thank you for sharing the latest. I see the exact same behavior.

     

    First off, I would like to thank you for your patience and effort in this matter, and also say that this process of an out-of-tree driver is not straight-forward, and I will bring this up internally.

     

    I'll try to sum up to my best knowledge what I did to atleast make it compile properly:

    1. in CMakeLists.txt, add this before find_package(...):

    list(APPEND ZEPHYR_EXTRA_MODULES
      ${CMAKE_CURRENT_SOURCE_DIR}/drivers
    )

    2. create file driver/zephyr/module.yml, containing:

    build:
      cmake: .
      kconfig: Kconfig
    

     

    This will point the "ZEPHYR_EXTRA_MODULES" and append it to the zephyr buildsystem.

    3. I moved your drivers folder structure a bit.

     

    Here is the .zip with the above changes. I was not able to successfully test it, but it does compile now:

    testlcd_outoftree_driver.zip

     

    Could you see if you also get this to run on your end?

     

    Kind regards,

    Håkon

Related