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

Parents
  • 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 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)
    

  • Those commits weren't back to back, but I'm fighting the same issue and so just iterated through 'git bisect'.  Here is the final output:

    b5123a4edfe18cdd80a5d1972feb9791b8463e25 is the first bad commit
    commit b5123a4edfe18cdd80a5d1972feb9791b8463e25
    Author: Robert Lubos <[email protected]>
    Date:   Thu Apr 4 14:51:57 2019 +0200
    
        manifest: update fw-nrfconnect-zephyr
    
        Update fw-nrfconnect-zephyr revision to reference latest upmerge.
    
        Signed-off-by: Robert Lubos <[email protected]>
    
    :100644 100644 fc4ad48cc887a00a67d7be32da7b4891057df750 d049a0e6ba8e5cf227c3f9e403c4551caee7d4c0 M      west.yml

  • Another clue: I was able to build from HEAD of master on an Ubuntu setup, and my failing builds earlier today were on Windows.  Now I'm hoping it's something stupid like a /-vs-\ slash item in some Kconfig or CMake file somewhere...

  • Oh man. Continuous integration should include windows buildts too.. Maybe use appveyor.

     can you please have the devs take a look at this. Alternatively Gregory, you can actually do a git blame on the line in question and find the commit then make a comment I think...hmm

  • Sorry for the delayed response everyone. I have been on a business trip & am now on vacation. Due to Easter break there will be lower support staffing, but DevZone should be fully staffed again next week from the 23rd of April. I will take a look at this case ASAP once I am back in office. You should have an answer latest by the 24th of April.

    The examples in the master branch have not been as rigorously tested as the tagged versions of Nordic Connect SDK, so there are bound to be more bugs in the master branch.

Reply Children
  • There has to be a new release tagged sometime soon, right?

  • Yes, there should be a new release tagged soon. In regards to the NCS master branch, there has been an update in this blog post here. Segger finally has support for the Zephyr master branch now! 

    I have tested this myself & followed the following procedure (using Windows 10). Remember to run choco commands using an Administrator command prompt. First, I upgraded to the latest nRF Getting Started Assistant guide in nRF Connect. If you have already installed the toolchain, you can skip the first two commands:

    choco feature enable -n allowGlobalConfirmation
    choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
    

    For all of the following choco install commands, I instead ran choco upgrade (see example below):

    choco upgrade git

    After each upgrade, I verified the upgrade by pressing the Verify button in the nRF Connect for Desktop app.

    In the "Clone the nRF Connect SDK" section, I ran the following command first:

    pip3 install west --upgrade

    I then created a new ncs folder. After running the "west init" command, I then ran "west update" when prompted to do so in the command prompt (if you want to use the master branch). If you want to use a tagged branch, see the command below this one. I was not able to verify the west init step unfortunately (most likely because I named by ncs folder ncs_master instead of ncs).

    I then deleted the old Segger v4.14 (the one used for NCS) & installed the new v4.16. I find it is helpful to make a shortcut of the emStudio.exe file. That way, you won't need to go to that folder every time you want to launch SES.

    The first time, I received an error code 1. I needed to change the zephyr base as described in the linked blog post.

    If you have any more questions regarding this, please open a new devzone case, as this thread is becoming large & slightly disorganized.

Related