Missing information about custom overlay(s) and/or custom out-of-tree driver(s) in the build log

Hi Nordic/Zephyr Community,

observer behavior:

-- west build: generating a build system
LIBRARY_SDK_BASE:= C:\cm\projects\zorbit\library_sdk
ZEPHYR_BASE:= c:\cm\ncs\v2.1.2\zephyr
Loading Zephyr default modules (Zephyr base).
-- Application: C:/cm/projects/zorbit/application
-- Found Python3: C:/cm/ncs/toolchains/v2.1.2/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Cache files will be written to: C:/cm/ncs/v2.1.2/zephyr/.cache
-- Zephyr version: 3.1.99 (C:/cm/ncs/v2.1.2/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf52840_zorbit
-- Found host-tools: zephyr 0.14.1 (C:/cm/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found dtc: C:/cm/ncs/toolchains/v2.1.2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (C:/cm/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found BOARD.dts: C:/cm/projects/zorbit/library_sdk/boards/arm/nrf52840_zorbit/nrf52840_zorbit.dts
-- Generated zephyr.dts: C:/cm/projects/zorbit/application/build_zorbit/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/cm/projects/zorbit/application/build_zorbit/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/cm/projects/zorbit/application/build_zorbit/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/cm/projects/zorbit/application/build_zorbit/zephyr/dts.cmake


Expected behavior:

-- west build: generating a build system
LIBRARY_SDK_BASE:= C:\cm\projects\zorbit\library_sdk
ZEPHYR_BASE:= c:\cm\ncs\v2.1.2\zephyr
Loading Zephyr default modules (Zephyr base).
-- Application: C:/cm/projects/zorbit/application
-- Found Python3: C:/cm/ncs/toolchains/v2.1.2/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Cache files will be written to: C:/cm/ncs/v2.1.2/zephyr/.cache
-- Zephyr version: 3.1.99 (C:/cm/ncs/v2.1.2/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf52840_zorbit
-- Found host-tools: zephyr 0.14.1 (C:/cm/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found dtc: C:/cm/ncs/toolchains/v2.1.2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (C:/cm/ncs/toolchains/v2.1.2/opt/zephyr-sdk)
-- Found BOARD.dts: C:/cm/projects/zorbit/library_sdk/boards/arm/nrf52840_zorbit/nrf52840_zorbit.dts
-- Found driver: C:\cm\projects\zorbit\library_sdk\dts\nrf52840_zorbit.overlay
-- Found driver: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100
-- Found YAML: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100.yml
-- Generated zephyr.dts: C:/cm/projects/zorbit/application/build_zorbit/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/cm/projects/zorbit/application/build_zorbit/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/cm/projects/zorbit/application/build_zorbit/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/cm/projects/zorbit/application/build_zorbit/zephyr/dts.cmake

Description:
It would be very helpful during development of custom device driver(s) the see in the build logging that the buildsystem has found & accepted the found overlay's and found drivers.
not sure if there is any work-around or other way to see this valuable build information about out-of-tree device drivers / overlays and perhaps also shields.

Reproduce steps:
- add out-of-tree custom device driver to the application
- build the application
- observe in the build log that no detected overlay is reported.
- observe in the build log that no detected driver is reported.

System:
- MS windows 11
- MS VSCode v1.73
- Nordic nRF Connect SDK v2.1.2
- hardware device custom pcb with nrf52840 & bg9x

 

Parents
  • Hi,

    Thank you very much once again for your valuable feedback Smiley

    I have reported internally.

    Regards,

    Priyanka

  • Hi,

    I have heard back from the team and they want to clarify some questions.

    question 1:

    Found driver: C:\cm\projects\zorbit\library_sdk\dts\nrf52840_zorbit.overlay**

    First, a devicetree overlay is not a driver, so this request does not make sense.

    Second, if what you want is for the build system to print all the devicetree overlays which are included in the build, this is already done. Here is an example:

    $ west build -b nrf52840dk_nrf52840 zephyr/samples/subsys/usb/cdc_acm
    ...
    -- Found devicetree overlay: /home/mbolivar/ncs/zephyr/samples/subsys/usb/cdc_acm/app.overlay
    ... 

    They think there is nothing more to do here. Please confirm.

    question 2:

    Found driver: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100**

    First, a directory containing devicetree bindings is not a driver either, so this too does not make sense.

    What do you really want?

    question 3:

    Found YAML: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100.yml**

    The build system doesn't have a way to distinguish the devicetree bindings which are provided with NCS from other devicetree bindings provided by the customer, nor do I see an easy way to make that happen.

    Would you be satisfied with changes which allow you to print:

    1. all the devicetree bindings discovered at cmake time?
    2. just the devicetree bindings which matched nodes in the final devicetree?
    3. the binding file which was used to match each node in the devicetree, along with nodes that didn't match any bindings?
Reply
  • Hi,

    I have heard back from the team and they want to clarify some questions.

    question 1:

    Found driver: C:\cm\projects\zorbit\library_sdk\dts\nrf52840_zorbit.overlay**

    First, a devicetree overlay is not a driver, so this request does not make sense.

    Second, if what you want is for the build system to print all the devicetree overlays which are included in the build, this is already done. Here is an example:

    $ west build -b nrf52840dk_nrf52840 zephyr/samples/subsys/usb/cdc_acm
    ...
    -- Found devicetree overlay: /home/mbolivar/ncs/zephyr/samples/subsys/usb/cdc_acm/app.overlay
    ... 

    They think there is nothing more to do here. Please confirm.

    question 2:

    Found driver: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100**

    First, a directory containing devicetree bindings is not a driver either, so this too does not make sense.

    What do you really want?

    question 3:

    Found YAML: C:\cm\projects\zorbit\library_sdk\dts\bindings\stc3100.yml**

    The build system doesn't have a way to distinguish the devicetree bindings which are provided with NCS from other devicetree bindings provided by the customer, nor do I see an easy way to make that happen.

    Would you be satisfied with changes which allow you to print:

    1. all the devicetree bindings discovered at cmake time?
    2. just the devicetree bindings which matched nodes in the final devicetree?
    3. the binding file which was used to match each node in the devicetree, along with nodes that didn't match any bindings?
Children
  • Hi Pryanka,

    My mistake it should be :

    Found overlay: C:\cm\projects\zorbit\library_sdk\dts\nrf52840_zorbit.overlay**

    But then why does the message no popup when the overlay is the folder?



  • Hi Priyanka,

    Thanks for the reply.

    I am making a generic re-useable external library for ncs/zephyr
    The library is used by several products each having their own custom pcb and other IC.

    product a has a stc3100 battery gauge
    product b has a ds2781 battery gauge
    product c has a other battery gauge


    My the library contains all the battery gauges folder lib/src/driver holding the custom device drivers (in seperate folders)
    and the library contains all the boards folder Boards
    and the library contains all the custom device drivers.


    My overlay is there to add the specific battery gauge to a i2c bus-master of a board.
    and the stc3100 properties are validated by the yaml.

    I am create a out-of-tree device driver for the st,stc3100 and add that external library to some boards within my project.


    What do I want :
    During development of the custom device driver I did notice the build system does not show all discovered & found overlay files and/or  device drivers. This is very uncomfortable for the developer believing his code is not detected or working.

    Zephyr is a very flexible system in which the developer can make a mess out-of-it this is also it's pitfall 
    so a little help from the build system to show detected overlays & custom device drivers would be very welcome.

    If I do something things related to device drivers weird or wrong please advise me....

    If possible show me a proper guide how to do this stuff
    Most guide I did read are very limited to just one thing and never I do read articles covering combined things.

    Best regards
        nRF5xFanBoy

  • Thank you very much for the reply. I have passed the information onto the experts.

    -Priyanka

  • Hi Priyanka,

    Meanwhile I discovered that the following:

    The Zephyr  website says:

    If you don’t set DTC_OVERLAY_FILE, the build system will follow these steps, looking for files in your application source directory to use as devicetree overlays:
    
    If the file boards/<BOARD>.overlay exists, it will be used.
    
    If the current board has multiple revisions and boards/<BOARD>_<revision>.overlay exists, it will be used. This file will be used in addition to boards/<BOARD>.overlay if both exist.
    
    If one or more files have been found in the previous steps, the build system stops looking and just uses those files.
    
    Otherwise, if <BOARD>.overlay exists, it will be used, and the build system will stop looking for more files.
    
    Otherwise, if app.overlay exists, it will be used.
    


    I placed the my overlay file in my external zephyr library subfolder .\Boards\ but during the build none overlay was reported, like this:

    -- Found devicetree overlay: .../some/file.overlay

    I changed the cmakefile in the application folder of the project with:

    set(DTC_OVERLAY_FILE "$ENV{CUSTOM_SDK_BASE}/boards/${BOARD}.overlay")

    MESSAGE("DTC_OVERLAY_FILE:= ${DTC_OVERLAY_FILE}")

    pointing to the boards subfolder  in my external zephyr library...

    and wow to my surprise I did see the reporting 
    like this:

    -- Found devicetree overlay: .../boards/nrf52840_custom.overlay


    So I think two plausible reasons (still have to final - test & double check)

    1 - the build system only report due to the set DTC_OVERLAY_FILE 

    2 - if you don't set the DTC_OVERLAY_FILE  then zephyr is only looking in the
       <application root>/boards/
    and not in my custom zephyr library:
      <library root> / boards / arm / nrf52840_custom / nrf52840_custom.dts
    I got my custom overlay placed here 
      <library root> / boards / nrf52840_custom.overlay

    Due to zephyr documented writing the .\boards folder (not explicit mentioning the application \ boards \ *.overlay)

    It was logical to assume the zephyr documentation was talking about the boards subfolderr in my custom zephyr library:
      <library root> / boards / arm / nrf52840_custom / nrf52840_custom.dts

    So I did place my custom overlay file here 
      <library root> / boards / nrf52840_custom.overlay

    Hence I was very wondering why the build system did not find the overlay?
    Now I do  know because: zephyr is only looking in the <application root>/boards/

    My solution to adapt cmakelist.txt to set the DTC_OVERLAY_FILE works fine

    set(DTC_OVERLAY_FILE "$ENV{CUSTOM_SDK_BASE}/boards/${BOARD}.overlay")


    Best regards,
        nRF5xFanBoy

     

Related