This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Compiling the BLE mesh examples

Hello, 

I am trying to compile the samples from SDK_for_mesh_v4.2.0 but i have problem with my environment set-up. I am following closely the documentation but I think something is missing that i could not figure it out. I had installed all tools. But when I ran cmake -G Ninja .., I see a warning that it could not fine nRF5_SDK. I did the recommendation to run nRF5_SDK but I get the same error after that. I set an environment variable SDK_ROOT with value nRF5_SDK_16.0.0_98a08e2 because that is my SDK but still the same. I could not find the documentation where else I should set that. Sorry it looks a stupid question but it took me 2 days with out success. I am new to cmake/make/gcc etc. by the way, I was able to compile examples from nRF SDK v17 but I'm interested in BLE mesh. Below is my folder structure.

Thanks

  • Update, I updated the environment variable to nRF5_SDK_17 and new error is below.

    How could I set these options?

  • Hi,

    Can you walk me through step-by-step what you have done so far? What command did you run to get the above message?

  • Hi, thanks for reaching out. I am trying to follow the documentation on  nRF5 SDK for Mesh v4.2.0 > Getting started Building the mesh stack and examples. I have downloaded SDK for mesh 4.2.0 and SDK 17 ans shown in the folder structure above. I have nRF5x command line tool, CMAKE, GNU ARM, ninja installed. But when I can the command cmake -G Ninja .., I get the below warning.

    as suggested in the warning, I run nRF5_SDK and so the nRF5_SDK_16.0.0_98a08e2 was also in my directory as shown on my initial post. But after that, I still get the same error. on my PC, I set the environment variable SDK_ROOT to the directory of  nRF5_SDK_17 (also tried nRF5_SDK_16.0.0_98a08e2) but still I get the same error.

    It looks the ninja tools doesn't know the directory of the SDK_ROOT.

    There is also a tutorial in https://wiki.makerdiary.com/nrf52840-mdk/mesh/ but i'm still not able to successfully build. 

  • Did you make a build folder in the root of the Mesh SDK? Then run the command:

    cmake -G Ninja ..

    inside this build folder?

    Can you upload the whole log after you entered that command?

    Double check for typos in your path. 

  • yes I made a build directory nrf5_SDK_for_Mesh_v4.2.0\build and I am running the command here. Here is the log. I also tried to run ninja help that might give you a hint. 

    PS D:\Mago\nrf5_SDK_for_Mesh_v4.2.0\build> cmake -G Ninja ..
    -- Configuring CMake for nRF5 SDK for Bluetooth Mesh 4.2.0
    -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
    CMake Warning at CMake/FindSDK.cmake:24 (message):
    Could not find `patch` executable. Automatic patching of the nRF5 SDK not
    supported. See for diff to apply.
    Call Stack (most recent call first):
    CMakeLists.txt:49 (include)


    CMake Warning at CMake/FindSDK.cmake:56 (message):


    Could not find the nRF5 SDK. The build will fail.
    Please run the nRF5_SDK target to download it or provide the correct path
    using the -DSDK_ROOT option or setting the SDK_ROOT environment variable.
    After the download is complete, re-run `cmake`.

    Call Stack (most recent call first):
    CMakeLists.txt:49 (include)


    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/Mago/nrf5_SDK_for_Mesh_v4.2.0/build
    PS D:\Mago\nrf5_SDK_for_Mesh_v4.2.0\build> ninja help
    [1/1] All primary targets available:
    nRF5_SDK: phony
    edit_cache: phony
    rebuild_cache: phony
    all: phony
    build.ninja: RERUN_CMAKE
    clean: CLEAN
    help: HELP
    PS D:\Mago\nrf5_SDK_for_Mesh_v4.2.0\build>

Related