Develop complete Out of Tree solution using Nordic SDK

The problem I'm reporting is a build/structure problem for a project that resides outside the Nordic SDK.

The project I'm developing involves new boards, new drivers, new libraries. forward involves one application for an nrf9160 module and one for an nrf52832 module. it is very similar to the rather famous "example-application" example related to out of tree development.

My problem is that I can't compile the application correctly and I can't access the root of my repository, where the file zephyr/module.yml is located.

The structure of my project is very similar to the structure of the /nrf folder inside the SDK. Everything is very similar, without the /nrf/toolchain and /nrf/cmake folder, which I don't know if their lack could be responsible for my problem.

this similarity is visible in the following images:

NFR folder:

My personal Out of Tree project:

Compiling the project located inside the /nbiot folder I can't access and compile that are found for example in the driver/sensor/sps30 folder.

In this system the zephyr/module.yml file is not considered as an entry point. The same thing then for the Kconfig and the CMakeLists.txt which are in my root folder.

They are not considered, I can add random characters inside to check for this.

Instead, what is considered in any case is the v1.8.0/nrf/zephyr/module.yml file.

I would like to be able to include my project too, as a module, with the same mechanism where the NRF folder is treated as a module for Zephyr.

Some idea?

The objective of this work is to develop an out of tree project being able to update the SDK, for example to the new current version 2.2.0.

Thank you,
David

Parents
  • Hello Davide,

    Thank you for contacting DevZone at NordicSemi.

    You query is not super clear to me. Nonetheless, I will try to provide my view.

    Your folder setup doesn't look like a typical setup. Typically, we have:

            c:/ncs/                             This is the folder for everything related to ncs-sdk and toolchains.
            c:/ncs/v2.0.1/               is the ncs version 2.0.1
                                                         you can have multiple version.
            c:/ncs/v2.0.1/nrf/     contains all folder like boards, drivers, include, modules, samples, subsys etc.
            c:/ncs/myprojects/      this folder contains all projects created using VSCode

    and then within the project folder, we have custom-board and custom-driver folder, and CMakeLists.txt configured to include those.

    is your folder "nbiot" in the c:/ncs/v2.0.1/ ?

    We can access the built-in and custom drivers. Built-in drivers are included in c/ncs/v2.0.1/drivers/
    and for the out of tree custom drivers, please have a look at Zephyr-Out-Of-Tree driver.

    With regards,
    Naeem

Reply
  • Hello Davide,

    Thank you for contacting DevZone at NordicSemi.

    You query is not super clear to me. Nonetheless, I will try to provide my view.

    Your folder setup doesn't look like a typical setup. Typically, we have:

            c:/ncs/                             This is the folder for everything related to ncs-sdk and toolchains.
            c:/ncs/v2.0.1/               is the ncs version 2.0.1
                                                         you can have multiple version.
            c:/ncs/v2.0.1/nrf/     contains all folder like boards, drivers, include, modules, samples, subsys etc.
            c:/ncs/myprojects/      this folder contains all projects created using VSCode

    and then within the project folder, we have custom-board and custom-driver folder, and CMakeLists.txt configured to include those.

    is your folder "nbiot" in the c:/ncs/v2.0.1/ ?

    We can access the built-in and custom drivers. Built-in drivers are included in c/ncs/v2.0.1/drivers/
    and for the out of tree custom drivers, please have a look at Zephyr-Out-Of-Tree driver.

    With regards,
    Naeem

Children
  • Thanks Naeem for the reply.

    The answer is NO, my work paths are:

    c:/ncs/v1.8.0/      it contains Nordic SDK as usual

    c:/GIT_PROJ/slb/nbiot     it contains my project specific for narrow band module nrf9160

    Inside c:/GIT_PROJ/slb I have my "Out-of-Tree folders" boards, drivers, dts and include.

    Inside c:/GIT_PROJ/slb I have in particular three files that are not considered by the building system. This is my problem. These files are:

    c:/GIT_PROJ/slb/CMakeLists.txt:

    include_directories(include)
    
    add_subdirectory(drivers)
    
    set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR})

     

    c:/GIT_PROJ/slb/Kconfig.solari:

    rsource "drivers/Kconfig"

    c:/GIT_PROJ/slb/zephyr/module.yml:

    build:
      cmake: .
      kconfig: Kconfig.solari
      settings:
        board_root: .
        dts_root: .
        module_ext_root: .

    Thank you in advance,

    Davide

  • Hi Davide,

    So, your project folder is c:/GIT_PROJ/slb/

    Does that Out-of-Tree Zephyr sample help?

    Looks like CMakeList issue.

    Can you send your minimal (dummy) project with same configurations as you have to replicate the problem. 

    Mention files names that you wanted to include.

    Thanks,

    Naeem

  • Hello Naeem,

    I've seen Out-of_tree sample you sent me but this like others did not help me.

    In the attached project you will find a sample of a driver that also uses a custom board.

    In ./zephyr/module.yml and in CMakeLists.txt there are deliberately some errors (a string "ERROR ERROR ERROR") which make it clear that those files are not taken into consideration. That's the problem.


    In fact, when compiling I immediately find an error, where the SPS30 symbol is not found.

    The only way, wrong, for solve this from my side, is to put the directive in ./nbiot/Kconfig:

    rsource "../Kconfig.solari"

    and a similar thing for the CMakeLists.txt...but even so obviously the driver .c files are not compiled.

    The build system should use the ./zephyr/module.yml file to configure the build and entry points, if I understand, but it doesn't.

    I hope my problem is clear.

    Thanks in advance,
    Davide

    DEVZONE_OOT.7z

  • Hello Naeem,

    please download this archive, not the first one.

    Thank you in advance,

    Davide7178.DEVZONE_OOT.7z

Related