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


  • 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.

  • Hello, I downloaded the attached zip file and there seem to be missing files during the compile when doing: cmake -G Ninja -DGENERATE_SES_PROJECTS=ON -DPLATFORM=nrf52840_xxAA ..

    Did you do this step, and if so did you get something like this during the compilation?

    I ran the Segger project and got same errors as show in your post, after compiling the mesh sdk the errors disappeared. I'll attached your project here have a check,

    3108.nrf5_SDK_for_Mesh_v1.0.1_src.zip

    Regarding the nRF52810 dev kits they aren't compatible with mesh yet, have a look at this post:

    https://devzone.nordicsemi.com/f/nordic-q-a/29586/nrf52810

    Hope this helps

  • OMG Hadi - YES!! Your download compiles perfectly Slight smile

    On Monday, was planning to install VMWARE and then a true Ubuntu platform so we can stop with this Linux emulation and work in the real environment. My work PC is bloated now with CygWin, MingW and who knows what else in an attempt to get the compiler and the cMAKE tools installed. As stated before, confident we went down the wrong path here but many of these names including the Python installation is new to us. Respectively, we did not use the cmake but before leaving work on Friday, we started to use cmake and then found we are missing the gcc for arm embedded compiler. That started another lost journey of how to install that tool. I think a complete guide on how to perform the installation will help out a great deal for others (including us). The savior here is your post with the complete folder structure. As soon as we have some time, will revisit this again from scratch.

    Immediately, wish to test the mesh using a mix of nRF52832 & nRF52840 targets. Many many thanks for your assistance!! Bye for now.

Related