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

 

  • 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