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

  • Hi Davide,

    I am sorry I could not compile your project. Your custom board is even not appearing in the build configurations. Maybe I need to configure something ? 

    Also, again, I think your folder structure is different.

    We put "boards", "drivers" and other folders within project directory, which is not the case for your project.

    Also, a question: How do you expect "CMakeLists.txt" of the parent folder to be included?

    CMakeLists.txt of your project (in folder nbiot) does not have error.

    However, you are not including "/nbiot/src/drv" directory as well. 

    I would suggest you to change/update your folder structure, and if possible then send bare-minimal project (with a single board and single driver for example just to demonstrate the usecase).

    Regards,

    Naeem

  • Hello Naeem,

    Maybe my minimal project is not so good.


    However I had followed the "external-application" sample application, so we can work using it:

    https://github.com/zephyrproject-rtos/example-application

    My target is to compile that, copying content of "example-application" in C:\ncs\v1.8.0\example-application. Don't care about my personal project. This one has the same structure I want.

    I already try to compile "example-application" but I can't, CMakeLists.txt in parent folder is not included!! ./example-application/zephyr/module.yml for some reason doens't take part of the game.

    With the structure present there, in the external-application, I had for example the advantage of having in the root folder, the definition of the board, and in the projects (app, app2, app2,samples,nbiot...) (contained in subfolders), only the overlays of board.

    This is also the same structure that the c:\ncs\v1.8.0\nrf folder has...and it is also the structure that zephyr has in its "samples"... I struggle to understand why you suggest me to re-define each time, in every project, the custom drivers and the custom board. I thought that somehow the ./zephyr/module.yml file drives the inclusion of the files contained in the parent folder.

    So for CMakeLists.txt of parent folder inclusion I expected ./zephyr/module.yml creates this inclusion.

    How do you compile "external-application" ?

    Thank you,

    Davide

  • Hello David,

    Davide Alessandrini said:
    I already try to compile "example-application" but I can't,

    So I started with the same github repo, and I followed instructions given in the readme.

    After successfully initializing, updating and then building the "app" project using the west tool from cmd (command-line), I opened the local repo (example-application) using VS Code, and then added "app" as an application. I was able to compile it successfully. Image below shows the correct compilation using the board present in the parent directory (custom_plank board in this case), and also the folder structure.

    And, yes, now when I put deliberate error in the parent CMakeLists.txt, it gets detected (snapshot below showing the error)

    Removing the error from parent CMakeLists.txt and the project compiles again correctly.

    I hope it helps,

    Naeem

  • Hi Naeem,
    the test you have done is very important. It makes me realize that something is wrong with my system.
    If I compile the example-application with VSCode I encounter two problems:


    1) The compilation fails because the driver is not found:

    2) If I insert an error in the CMakeLists.txt of the parent folder I don't perceive an error, but the compilation is identical to point 1).

    In practice the problem is always the same: my build system has something wrong.
    The latest SDK I have installed is 2.2.0.

    I have NOT compiled with west previously.

    Davide

  • I add that, following the procedure of the example-application Readme, zephyr is installed inside the workspace. This thing is not what I want because I want to use the Nordic SDK which contains Zephyr. I want to use all of Nordic also because I need the modem, I need many things that are inside the Nordic SDK.
    For example, how would you, in the current state of your "example-application" folder, send an AT command to nrf9160's modem? or use MQTT?
    In general our project is similar to the "asset_tracker_v2" application... but I want to find the way to work as in example-application (= all drivers, boards, bindings out-of-tree) but use the Nordic SDK .

    Thank you in advance,

    Davide

Related