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

Parents
  • 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.

Reply
  • 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.

Children
  • 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

  • Hi,

     

    Paultino_nordost said:

    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?

    Just for reference, T3 is a forest topology:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/develop/west/workspaces.html#t3-forest-topology

    "manifest-repo" is a arbitrary name that matches where the west.yml is located.

    This could have been any name, as long as the initial west workspace (.west/config) points towards this path.

     

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

    This is done when you initialize your west workspace, as shown in the file view here:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/installation/install_ncs.html#get-the-ncs-code

    .west will be automatically generated to point towards your workspace's west.yml. In the above case, it will be <west-workspace>/nrf/west.yml.

     

    Kind regards,

    Håkon

  • Hi all,

    Thanks everyone. I'm done. Came out.

    Apparently Zephyr doesn’t want to be friends with me. It was easier for me to find the reason for a non-working example and figure out how to write a driver than to configure it to work without errors. This happened first today

    Then, after the update of the West, this.

    Traceback (most recent call last):
      File "<frozen runpy>", line 198, in _run_module_as_main
      File "<frozen runpy>", line 88, in _run_code
      File "C:\Program Files\Python311\Scripts\west.exe\__main__.py", line 7, in <module>
      File "C:\Program Files\Python311\Lib\site-packages\west\app\main.py", line 1085, in main
        app.run(argv or sys.argv[1:])
      File "C:\Program Files\Python311\Lib\site-packages\west\app\main.py", line 236, in run
        self.load_manifest()
      File "C:\Program Files\Python311\Lib\site-packages\west\app\main.py", line 254, in load_manifest
        self.manifest = Manifest.from_topdir(topdir=self.topdir,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\west\manifest.py", line 1207, in from_topdir
        return Manifest(topdir=topdir, config=config,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\west\manifest.py", line 1499, in __init__
        current_data=validate(self._ctx.current_data))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\west\manifest.py", line 541, in validate
        as_dict = _load(data)
                  ^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\west\manifest.py", line 207, in _load
        return yaml.safe_load(data)
               ^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\__init__.py", line 125, in safe_load
        return load(stream, SafeLoader)
               ^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\__init__.py", line 81, in load
        return loader.get_single_data()
               ^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\constructor.py", line 49, in get_single_data
        node = self.get_single_node()
               ^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\composer.py", line 36, in get_single_node
        document = self.compose_document()
                   ^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\composer.py", line 55, in compose_document
        node = self.compose_node(None, None)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\composer.py", line 84, in compose_node
        node = self.compose_mapping_node(anchor)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\composer.py", line 127, in compose_mapping_node
        while not self.check_event(MappingEndEvent):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\parser.py", line 98, in check_event
        self.current_event = self.state()
                             ^^^^^^^^^^^^
      File "C:\Program Files\Python311\Lib\site-packages\yaml\parser.py", line 438, in parse_block_mapping_key
        raise ParserError("while parsing a block mapping", self.marks[-1],
    yaml.parser.ParserError: while parsing a block mapping
      in "<unicode string>", line 4, column 1:
        manifest:
        ^
    expected <block end>, but found '<block mapping start>'
      in "<unicode string>", line 11, column 3:
          remotes:
          ^
    

    I did everything according to the instructions, but apart from simple examples, nothing works for me.

    I need to make my way through the dark forest.

    Isn't it true that 100 days is a lot to build an example of display output? And most of them were spent looking for errors in the environment configuration.

    I even conducted an experiment on a clean installation of Ubuntu.

    "Application-example" west build -b nrf52840dk_nrf52840 had a build error.

    I went back to the SDK.

    I wanted two simple things.

    1. There is no duplicate of the original Zephyr files, since they are already on the disk.
    2. Don't publish my applications to Git.

Related