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

Issue with command line compilation of NRF9160 samples

Hello,

I have configured the toolchain and SDK by following the NRF Connect getting started guide and followed the below steps to compile the mqtt_simple application (on master branch and using a MAC):

export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb

export GNUARMEMB_TOOLCHAIN_PATH="/path/to/gcc-arm-none-eabi-Qx-2018/"

source /path/to/ncs/zephyr/zephyr-env.sh

cd /path/to/ncs/nrf/samples/nrf9160/mqtt_simple/

mkdir build && cd build

cmake .. -DBOARD=nrf9160_pca10090ns -GNinja

After executing cmake this is the output:

Zephyr version: 1.14.0

-- Selected BOARD nrf9160_pca10090ns

-- Found west: /usr/local/bin/west (found suitable version "0.5.5", minimum required is "0.5.4")

-- Loading /path/to/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.dts as base

-- Overlaying /path/to/ncs/zephyr//dts/common/common.dts

Parsing Kconfig tree in /path/to/ncs/nrf/samples/nrf9160/mqtt_simple/Kconfig

Loading /path/to/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns_defconfig as base

Merging /path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf

/path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf:11: warning: attempt to assign the value 'y' to the undefined symbol LTE_LINK_CONTROL
/path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf:12: warning: attempt to assign the value 'n' to the undefined symbol LTE_AUTO_INIT_AND_CONNECT
/path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf:15: warning: attempt to assign the value 'y' to the undefined symbol BSD_LIBRARY
/path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf:19: warning: attempt to assign the value 'y' to the undefined symbol AT_HOST_LIBRARY

Error: Aborting due to non-whitelisted Kconfig warning
'/path/to/ncs/nrf/samples/nrf9160/mqtt_simple/prj.conf:11: warning: attempt to
 assign the value 'y' to the undefined symbol LTE_LINK_CONTROL'.
Note: If this warning doesn't point
 to an actual problem, you can add it to the whitelist at the top of
/path/to/ncs/zephyr//scripts/kconfig/kconfig.py.
CMake Error at /path/to/ncs/zephyr/cmake/kconfig.cmake:191 (message):

command failed with return code: 1

Call Stack (most recent call first):
/path/to/ncs/zephyr/cmake/app/boilerplate.cmake:397 (include)

CMakeLists.txt:9 (include)


-- Configuring incomplete, errors occurred!

Any help would be appreciated.

Kind regards

  • Thanks for letting us know! We are aware of this issue & are busy looking for a fix.

    Thanks for the tips!

    In addition to using cmake & ninja, it is also possible to use the Zephyr west tool to build & program the board. These two links helped me figure this out: link 1, link 2.

    Inside ncs/zephyr/zephyr-env.cmd:

    @echo off
    set ZEPHYR_BASE=%~dp0
    
    if exist "%userprofile%\zephyrrc.cmd" (
    	call "%userprofile%\zephyrrc.cmd"
    )
    

    If you define zephyrrc.cmd inside your user profile (i.e. C:/Users/<username>/), you can write:

    @echo off
    echo zephyrrc_running
    
    set ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    set GNUARMEMB_TOOLCHAIN_PATH=C:\gnuarmemb
    

    That way, when you call zephyr-env.cmd from a command prompt window, you set the Zephyr base, zephyr toolchain variant & gnuarmemb toolchain path without needing to write the three commands each time. This may not work with a bash window (e.g. git bash) because the username may be different.

    You can then follow this link to download NCS using west. To build the at_client example for example, change directory to ncs/samples/nrf9160/at_client & then run the following commands:

    west build -b nrf9160_pca10090ns -d build
    west flash -d build
    
    

    You can then flash using:

    west flash -d build

  • I am still getting similar errors when trying to build for the secure boot (now called spm?):

    $ cmake -DBOARD=nrf9160_pca10090 -GNinja ..
    -- Using application from 'C:/PROJECTCODE/ncs/nrf/samples/nrf9160/spm'
    Zephyr version: 1.14.0
    -- Found PythonInterp: C:/Python37/python.exe (found suitable version "3.7.2", minimum required is "3.4")
    -- Selected BOARD nrf9160_pca10090
    -- Found west: C:/Python37/Scripts/west.exe (found suitable version "0.5.7", minimum required is "0.5.6")
    -- Cache files will be written to: C:\Users\ruben\AppData\Local/.cache/zephyr
    -- Loading C:/PROJECTCODE/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090.dts as base
    -- Overlaying C:/PROJECTCODE/ncs/zephyr/dts/common/common.dts
    -- Overlaying C:/PROJECTCODE/ncs/nrf/samples/nrf9160/spm/nrf9160_pca10090.overlay
    
    C:/PROJECTCODE/ncs/nrf/samples/nrf9160/spm/prj.conf:2: warning: attempt to assign the value 'y' to the undefined symbol SPM
    Parsing Kconfig tree in C:/PROJECTCODE/ncs/zephyr/Kconfig
    Loading C:/PROJECTCODE/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090_defconfig as base
    Merging C:/PROJECTCODE/ncs/nrf/samples/nrf9160/spm/prj.conf
    
    Error: Aborting due to non-whitelisted Kconfig warning
    'C:/PROJECTCODE/ncs/nrf/samples/nrf9160/spm/prj.conf:2: warning: attempt to assign the value 'y' to
    the undefined symbol SPM'. Note: If this warning doesn't point to an actual problem, you can add it
    to the whitelist at the top of C:/PROJECTCODE/ncs/zephyr/scripts/kconfig/kconfig.py.
    
    CMake Error at C:/PROJECTCODE/ncs/zephyr/cmake/kconfig.cmake:191 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/PROJECTCODE/ncs/zephyr/cmake/app/boilerplate.cmake:476 (include)
      CMakeLists.txt:3 (include)
    

  • Have you deleted the build folder before you tried building the spm example? I tried to build using the:

    west build -b nrf9160_pca10090 -d build

    which worked. When building the spm example, it is important to set the board to nrf9160_pca10090 instead of nrf9160_pca10090ns because the spm example sets the secure peripherals. Therefore, you should not use the nrf9160_pca10090ns, which refers to the non-secure version of the board. Use the nrf9160_pca10090 board instead.

  • Thank you. Are these commits back to back? If so, I think you've just given Nordic a big clue as to what caused the problem.

Related