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

  • Hi,

     

    Based on your project, it seems that you have converted from a "workspace application" to a "freestanding application".

     

    You are adding an addition to the already present ili-display drivers in zephyr, as seen from the output when you're configuring:

    Loading Zephyr default modules (Zephyr base).
    -- Application: /tmp/test
    -- CMake version: 3.22.1
    -- Found Python3: /usr/bin/python (found suitable version "3.10.12", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/hkn/.cache/zephyr
    -- Zephyr version: 3.5.0 (/opt/repos/upstream-zephyr/zephyr)
    -- Found west (found suitable version "1.0.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Shield(s): waveshare_3_5_tft_sku_13506
    -- Found host-tools: zephyr 0.16.0 (/opt/zephyr-sdk/zephyr-sdk-0.16.0)
    -- Found toolchain: zephyr 0.16.0 (/opt/zephyr-sdk/zephyr-sdk-0.16.0)
    -- Found Dtc: /usr/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
    -- Found BOARD.dts: /opt/repos/upstream-zephyr/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Found devicetree overlay: /tmp/test/boards/shields/waveshare_3_5_tft_sku_13506/waveshare_3_5_tft_sku_13506.overlay
    -- Found devicetree overlay: /tmp/test/boards/shields/waveshare_3_5_tft_sku_13506/boards/nrf52840dk_nrf52840.overlay
    -- Generated zephyr.dts: /tmp/test/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /tmp/test/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /tmp/test/build/zephyr/dts.cmake
    
    warning: ILI9486 (defined at /tmp/test/drivers/display/Kconfig.ili9xxx:8) was assigned the value 'y'
    but got the value 'n'. Check these unsatisfied dependencies: DT_HAS_ILITEK_ILI9486_ENABLED (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_ILI9486 and/or look up ILI9486 in the
    menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
    and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
    
     

    The symbol "DT_HAS_ILITEK_ILI9486_ENABLED" has not been selected, which comes from your device tree.

    This seems to be non-selected in waveshare_3_5_tft_sku_13506.overlay:

    ...Line 49
    	ili9486_waveshare_3_5_tft_sku_13506: ili9488@0 {
    		compatible = "ilitek,ili9488";
    ...

    I assume you want the compatible to be "ilitek,ili9486" and "ili9486@0"?

     

    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).

    There is a conflict in your kconfig, where you select the symbol "ILI9XXX". This is present both in zephyr (see here: https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/drivers/display/Kconfig.ili9xxx#L8-L11) as well as in your application drivers/display/Kconfig.ili9xxx.

    You have to rename your kconfig symbol to avoid a conflict.

     

    Kind regards,

    Håkon

  • Sorry, an old file got caught while preparing the zip. I tested it on it and now ili9486 is there.

    Apparently my problems are due to the fact that I did not understand the role of the manifest file, and in it the term
    "repository of your application".
    I don't use git, and maybe that's why these things are not clear.
    The examples that come with Zephyr contain the file "sample.yaml", but how does it relate to "west.yaml" is not entirely clear.

    You're right, I got a mix of Star topology and Forest topology.

    My folder structure:

    west-workspace/
    │
    ├── applications
    │       │
    │       ├── app1/               
    │       │     ├── CMakeLists.txt
    │       │     ├── prj.conf
    │       │     └── src/
    │       │          └── main.c
    │       ├── app2/             
    │             ├── CMakeLists.txt
    │             ├── prj.conf
    │             └── src/
    │                   └── main.c
    ├── manifest-repo/
    │   └── west.yml  
    ├── modules/
    │   └── lib/
    │
    └── zephyr/          
        └── west.yml 

    My west.yml in manifest-repo

    manifest:
      defaults:
        remote: remote2
    
       remotes:
        - name: zephyrproject-rtos
          url-base: https://github.com/zephyrproject-rtos
        - name: remote1
          url-base: https://github.com/####
        - name: remote2
          url-base: https://github.com/####
    
      projects:
        - name: zephyr
          remote: zephyrproject-rtos
          import: 
        - name: testlcd
          description: the test LCD example project
          remote: remote1      # The remote url-base is appended with a / and the project name to form the URL.
          path: applications/testlcd
        - name: testlaborigintft
          description: the test LCD project from sample (not use ili9488 driver)
          remote: remote2
          path: applications/testlaborigintft
      self:
        path: manifest-repo

    I was trying to avoid multiple duplicates of the original Zephyr files.

    Thanks for the reply.
    I will check my Kconfig today.

    The ili9xxx driver is universal, but it does not work with ili9486.
    And I thought that the priority in connecting driver files is higher in the application than in what is in Zephyr.
    But this is not a question for you.

    Thanks again.
    I spent a lot of time getting a working sample of 52840dk+waveshare sku-13506 + zephyr + lvgl, and lost motivation.

    The ticket can be closed.

  • This duplicate worries me.

    I can't afford multiple identical copies of Zephyr.

    The application is on the right, the ncs is on the left.

  • Hi,

     

    You should then use a freestanding application:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/create_application.html#freestanding-application

    This will then point to your already defined ZEPHYR_BASE, in this case; c:\ncs\v2.5.1\zephyr folder.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Question about T3 and .west/config

    I did not find the "manifest-repo" in the source code, and the documentation at this point is not clear to me.

    Do I need to write [manifest] path = manifest-repo in .west/config or does west automatically go to this folder?

    This line is different in T1 and T2

Related