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

  • Which version of the GNU ARM EMB toolchain are you using? v7 q2 from 2018 or v8 q4 from 2018? If you are using v8 q4, this may be related to this. Could you try using v7 q2 from 2018 instead?

    It may also be the way you have structured your cmake command. Have you taken a look at this link to see how to build the zephyr master branch?

    In addition, in your prj.conf file in the mqtt_simple folder, does it say CONFIG_LTE_LINK_CONTROL=y or LTE_LINK_CONTROL=y. If it is the latter, I would change it to the former.

  • Thanks for replying. I've tried all all of your suggestions but the problem persists.

    1. I changed the the gcc compiler to version you specified (v7 q2 from 2018) and have tried three other versions.

    2. The link you provided is what I have followed originally, I've also changed the structure of the cmake command.

    3. Changing prj.conf values will throw the following error e.g: 'warning: ignoring malformed line 'LTE_LINK_CONTROL=y''

  • Ok, managed to get this to work i.e, build, compile and flash.

    Before anything, follow the steps in the NRF Connect making sure all dependancies are installed but stay on Master branch.

    Set up your .bash_profile like this:

    export ZEPHYR_BASE=/path/to/ncs/zephyr
    export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    export GNUARMEMB_TOOLCHAIN_PATH=/path/to/gcc-arm-none-eabi-7-2018-q2-update
    source /path/to/ncs/zephyr/zephyr-env.sh

    From the ncs root directory:
    west init -l nrf
    west update

    Go to mqtt_simple/build ( clean the build folder if already exists )
    cmake -DBOARD=nrf9160_pca10090ns -GNinja ..

    NOTE: You may get an error about ‘pykwalify’ not being installed:
    pip uninstall pykwalify
    pip install pykwalify

    Run cmake:
    cmake -DBOARD=nrf9160_pca10090ns -GNinja ..
    ninja
    ninja flash

    NOTE: Make sure you have the latest nrfjprog otherwise the ninja flash command won’t work and will complain about memory access alignment. And of course, the secure boot should be flashed prior to the main application.

  • I have the same problem.

    The issue is that with Segger Embedded Studio 4.14 (Nordic Version) it is NOT possible to build code after 0.3.X.
    It works on the command line with generating ninja files with cmake and then building with ninja.

    If I copy the command line that is displayed in the SES output it works also!!!
    Therefore the environment variables that I set in the .bashrc are obviously set in the terminal but do not get defined when starting SES from the desktop, make the difference.
    If I start SES directly from the terminal it works also.

    What also works is starting the project with SES then coping the command line to the terminal and let the project generate. Then I can open the project normally with SES.

    So Nordic / Segger  please have a look at this issue ....

    Best regards

    - Martin

Related