Building an application with out-of-tree driver module

Hi

Im trying to build an application which has an out of tree driver for an i2c based sensor

i tried these steps, but it resulted in the following error

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/example-application/app
-- CMake version: 3.26.4
-- Found Python3: C:/Users/NEEVEE TECH/AppData/Local/Programs/Python/Python311/python.exe (found suitable version "3.11.0", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/.cache
-- Zephyr version: 3.6.99 (C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf52840dk, qualifiers: nrf52840
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
CMake Error at C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/cmake/modules/FindZephyr-sdk.cmake:109 (find_package):
  Could not find a package configuration file provided by "Zephyr-sdk"
  (requested version 0.16) with any of the following names:

    Zephyr-sdkConfig.cmake
    zephyr-sdk-config.cmake

  Add the installation prefix of "Zephyr-sdk" to CMAKE_PREFIX_PATH or set
  "Zephyr-sdk_DIR" to a directory containing one of the above files.  If
  "Zephyr-sdk" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/cmake/modules/FindHostTools.cmake:53 (find_package)
  C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/cmake/modules/dts.cmake:9 (find_package)
  C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/cmake/modules/zephyr_default.cmake:132 (include)
  C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/Users/Public/vs_projects/ncs_sample_oot/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=C:/Users/NEEVEE TECH/AppData/Local/Programs/Python/Python311/python.exe' '-BC:\Users\Public\vs_projects\ncs_sample_oot\my-workspace\example-application\build' -GNinja -DBOARD=nrf52840dk/nrf52840 '-SC:\Users\Public\vs_projects\ncs_sample_oot\my-workspace\example-application\app'

what am i doing wrong here??

Kindly guide me through the oot driver developement

Parents
  • Hi

    Have you checked out the "Adding your own code" page in the nRF Connect SDK documentation? It describes some user workflows on how to do out of tree development.

    As for the error you're seeing, it means the Zephyr SDK install didn't create a correct CMake package or couldn't find it. Have you tried doing as the build log suggests and add the installation prefix of "Zephyr-sdk" to CMAKE_PREFIX_PATH or set "Zephyr-sdk_DIR" to a directory containing the file? Where (what path) have you installed the nRF Connect SDK to in the first place?

    Best regards,

    Simon

  • Hi,

    Have you checked out the "Adding your own code" page in the nRF Connect SDK documentation? It describes some user workflows on how to do out of tree development.

    Tried following these steps, and it works now

    im able to build the GitHub - teslabs/zds-2022-drivers-app: Mastering Zephyr Driver Development (Sample Application) 

    with his custom driver files for nrf52840dk/nrf52840 as board

    Now, i try to build it for my custom board by adding the board/arm/(my_custom_board_folder)
    into the app folder (zds-2022-drivers-app/app/app) which has the entry cmakelists.txt, but it doesn't consider my custom board when building.

    after going through some tickets i added the line "list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})"
    into that cmakelists.txt before find_package line

    this made some progress, it considered my custom board while building , but it throws the following error

    warning: <choice> (defined at soc\Kconfig.v1.choice:5) defined with type unknown
    
    C:/Users/Public/vs_projects/ncs_oot_2/zds-2022-drivers-app/app/app/boards/arm/magnus_conductivity/magnus_conductivity_defconfig:4: warning: attempt to assign the value 'y' to the undefined symbol SOC_SERIES_NRF52X
    
    C:/Users/Public/vs_projects/ncs_oot_2/zds-2022-drivers-app/app/app/boards/arm/magnus_conductivity/magnus_conductivity_defconfig:5: warning: attempt to assign the value 'y' to the undefined symbol SOC_NRF52840_QIAA
    
    error: Aborting due to Kconfig warnings

    what am i missing here??, is this the way to build for a custom board in oot driver project??

    Thanks!

Reply
  • Hi,

    Have you checked out the "Adding your own code" page in the nRF Connect SDK documentation? It describes some user workflows on how to do out of tree development.

    Tried following these steps, and it works now

    im able to build the GitHub - teslabs/zds-2022-drivers-app: Mastering Zephyr Driver Development (Sample Application) 

    with his custom driver files for nrf52840dk/nrf52840 as board

    Now, i try to build it for my custom board by adding the board/arm/(my_custom_board_folder)
    into the app folder (zds-2022-drivers-app/app/app) which has the entry cmakelists.txt, but it doesn't consider my custom board when building.

    after going through some tickets i added the line "list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})"
    into that cmakelists.txt before find_package line

    this made some progress, it considered my custom board while building , but it throws the following error

    warning: <choice> (defined at soc\Kconfig.v1.choice:5) defined with type unknown
    
    C:/Users/Public/vs_projects/ncs_oot_2/zds-2022-drivers-app/app/app/boards/arm/magnus_conductivity/magnus_conductivity_defconfig:4: warning: attempt to assign the value 'y' to the undefined symbol SOC_SERIES_NRF52X
    
    C:/Users/Public/vs_projects/ncs_oot_2/zds-2022-drivers-app/app/app/boards/arm/magnus_conductivity/magnus_conductivity_defconfig:5: warning: attempt to assign the value 'y' to the undefined symbol SOC_NRF52840_QIAA
    
    error: Aborting due to Kconfig warnings

    what am i missing here??, is this the way to build for a custom board in oot driver project??

    Thanks!

Children
No Data
Related