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

Unable to use cMAKE on Windows to compile for nRF52840 target

Hi. I am going down a rabbit hole. Wish to work with the SDK for Mesh using ideally the PCA10040 (nRF52832) and PCA10056 (nRF52840) kits.

1) Is this possible to mix the testing for the Nordic Light switch demo for server / client boards? It is that we only have 1 x PCA10040 kits in the lab but 3-4 of the PCA10056 kits.

2) Installed the Segger Studio as instructed in the docs and can very quickly compile the code for the nRF52832 target. Very intuitive tool. Can the same Segger compiler toolchain be used to target the PCA10056 kit (nRF52840) ?

3) Assuming no on the above, proceeded to download install the cMAKE and MingGW tools but stuck after this step.

What is next to make this all work?

mkdir build
cd build

cmake -G Ninja

returns with:

does not appear to contain cMakeLists.txt


Parents
  • Hello , I was in the same situation as you some days ago when discovering the mesh sdk, so no need to worry...

    Just to clarify, you can either use Segger embedded studio for flashing the program, or use cmake and make to compile the program and later flash it to the device.

    1. That should not be any problem I assume, since a node is a node no matter what development kit is used

    2. Right now in the mesh sdk 1.0.1 light switch example there is only "support" for the PCA10040 board, but in the mesh sdk 1.0 there is support for PCA10040 and PCA10056 board. I assume that PCA10040 should only be used with the PCA10040 board. Correct me if I am wrong..

    3. Have you followed the guide for setting up the toolchain for cmake in the mesh sdk root-->doc-->getting started? For compiling the files you will need to:

    1. mkdir build && cd build in the mesh sdk root folder
    2. then do cmake -G Ninja -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA .. (for nRF52840 board)
    3. And lastly do a make to compile the examples for flashing to the dev kit boards after

    EDIT: After answering your questions I found a post for generating a Segger project for desired dev kit board, please check this post:

    https://devzone.nordicsemi.com/f/nordic-q-a/30035/segger-embedded-studio-project-files-missing-in-mesh-sdk-v1-0-1

Reply
  • Hello , I was in the same situation as you some days ago when discovering the mesh sdk, so no need to worry...

    Just to clarify, you can either use Segger embedded studio for flashing the program, or use cmake and make to compile the program and later flash it to the device.

    1. That should not be any problem I assume, since a node is a node no matter what development kit is used

    2. Right now in the mesh sdk 1.0.1 light switch example there is only "support" for the PCA10040 board, but in the mesh sdk 1.0 there is support for PCA10040 and PCA10056 board. I assume that PCA10040 should only be used with the PCA10040 board. Correct me if I am wrong..

    3. Have you followed the guide for setting up the toolchain for cmake in the mesh sdk root-->doc-->getting started? For compiling the files you will need to:

    1. mkdir build && cd build in the mesh sdk root folder
    2. then do cmake -G Ninja -DTOOLCHAIN=gccarmemb -DPLATFORM=nrf52840_xxAA .. (for nRF52840 board)
    3. And lastly do a make to compile the examples for flashing to the dev kit boards after

    EDIT: After answering your questions I found a post for generating a Segger project for desired dev kit board, please check this post:

    https://devzone.nordicsemi.com/f/nordic-q-a/30035/segger-embedded-studio-project-files-missing-in-mesh-sdk-v1-0-1

Children
  • Thank you. Let me review with a strong cup of coffee. Believe I am missing the gcc and Ninja installation. The last Ninja I can recall is Michael Dudikoff. I think this installation procedure needs more hand holding, at least for me :) Will try again on a different PC. Thanks again.

  • Hello and thank you Hadi for your post. Still facing some issues but working with Segger toolchain.

    1) Downloaded the referenced project file to generate the Mesh Light example on the PCA10056 target as posted by Hung Bui.

    2) The compiler raised many errors due to missing header files (.h) so reviewed the Include Paths and then cut & past the folders that should have been there to compile this example.

    My folder structure is as follows:

    3) It has taken many hours of toying with this project to get this far and now the raised error is:

    Any ideas on how to resolve this error? From our limited knowledge, this define is for older SoftDevices (ie. S132 - according to the Nordic keyword search results) but we are on S140?

    There has to be something we are doing wrong for this to be taking so many hours and still unable to compile for the PCA10056 target (Mesh Light Example). Perhaps wiser to just order a few of the PCA10040 kits for testing. With regret, we thought we could run the mesh stack on the nRF52810 (read that somewhere in the docs) but that is not supported and is not on the roadmap? So the kits we just brought in from Fanstel will not allow us to be used for mesh networking. Also brought in the PPK which is apparently not working in low power mode - we wish to validate that the PCA10040 / PCA10056 can indeed enter low power mode to deploy with a CR2032 coin cell battery for a long period of time.

    Welcome any comments and really appreciate your assistance. Thanks again.

  • Hello, I suggest that you download the mesh sdk v1.0.1 from the beginning, extract it. When this is done then navigate into the sdk root through the terminal, do

    1. mkdir build && cd build
    2. cmake -G Ninja -DGENERATE_SES_PROJECTS=ON -DPLATFORM=nrf52840_xxAA ..

    This will generate the Segger project for pca10056 nRF52840. Just to mention you will need python and pip installed in order to generate Segger project. Also you will need to install jinja2 by doing pip install Jinja2 in the terminal. Afterwards you should see Segger project in the examples/light-switch/client or server example.

    Hope it helps!

  • Hi Kumar, 

     

    There must be an issue with the path, in my case the project worked out of the box. I suggest you to try with a fresh copy of the SDK. Make sure you use v1.0.1

     

    If it still doesn't work, please zip your example folder and we can test here. 

  • Hello. Still raising errors so attaching my complete folder.

    Some comments:

    1) Took the compiled Segger supporting project folder and attempted to compile. This was our first error as then there is no link to the SDK 1.0.1. Learned this the hard way. Upon each raised missing header file error, copied the required files from the SDK folder. Anyways, we should have instead copied your updated Light Switch example into the SDK 1.0.1 folder. We basically did this in reverse and consumed many hours. For the future reader, it will be best to show this detail step by step.

    Download the SDK 1.0.1 -> replace the Light Switch example with the updated version that does offer Segger support for the PCA10056.

    2) Even with following the above procedure that we just made aware of -> still raising an error of missing:

    From what we can see, this missing nrf_error.h file is inside the S132 softdevice folder. However the S132 softdevice is not valid for PCA10056 target or is it ok?

    The Segger include path does not offer searches for the S132 folder. Urghhh!!!!

    Our path structure does not include any reference to the S132 folder hence the raised error.nrf5_SDK_for_Mesh_v1.0.1_src.zip

    include

    ../include

    ../..

    ../../common/include

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/drivers_nrf/delay

    ../../../models/simple_on_off/include

    ../../../models/config/include

    ../../../models/health/include

    ../../../mesh/access/api

    ../../../mesh/access/include

    ../../../mesh/prov/api

    ../../../mesh/prov/include

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/boards

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/drivers_nrf/hal

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/libraries/util

    ../../../external/softdevice/s140_5.0.0-3.alpha/s140_nrf52840_5.0.0-3.alpha_API/include

    ../../../external/softdevice/s140_5.0.0-3.alpha/s140_nrf52840_5.0.0-3.alpha_API/include/nrf52

    ../../../mesh/core/api

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/device

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/cmsis/include

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/gcc

    ../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/dsp/GCC

    ../../../external/rtt/include

    ../../../mesh/core/include

    ../../../mesh/dfu/api

    ../../../mesh/dfu/include

    ../../../mesh/prov/api

    ../../../mesh/prov/include

    ../../../mesh/bearer/api

    ../../../mesh/bearer/include

    ../../../external/micro-ecc

    ../../../mesh/core/include

    3) We also own a Thing52 so perhaps we can use the Thing52 like the PCA10040 target to get moving on this testing with a server and client for the Light Switch demo? We did bring in the 0.05" pitch ribbon cable to use one of the Nordic PCBs to reflash the Thingy52.

    4) Would you please confirm if the nRF52810 is NOT able to support mesh? If true then the documentation needs to be updated to reflect this detail as we purchased some tools to evaluate this target.

Related