Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

warning: attempt to assign the value 'y' to the undefined symbol

I found a lot of posts with this warning/error, but I could not find a fitting solution among them.

in my case, I copied the `peripheral_lbs` project to another folder,
then sourced the zephyr environment script from ncs/vX.X.X/zephyr and
ran west build in the project folder.
the error is:

`warning: attempt to assign the value 'y' to the undefined symbol NCS_SAMPLES_DEFAULTS`

I assume the reason is that NCS_SAMPLES_DEFAULTS is not a Zephyr definition, but a nordic specific one.
A google search gave me this result, what supports my assumption:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index-nrf.html

How do I tell kconfig/west (?) that there are more symbols available?

  • I was not able to reproduce the warning message. I did the following:

    • Placed ncs\v1.4.2\nrf\samples\bluetooth\peripheral_lbs\src\main.c into C:\Nordic\samples
    • Opened the command line in C:\Nordic\samples\peripheral_lbs
    • Set the zephyr base: set ZEPHYR_BASE=C:\Users\Simon\ncs\v1.4.0\zephyr
    • Built the sample: west build -b nrf52840dk_nrf52840 -d build_52840dk_no1

    I did not get the warning message you mentioned.

    Could you provide details steps on how to reproduce this?

    Best regards,

    Simon

  • I took a look at your other case: https://devzone.nordicsemi.com/f/nordic-q-a/71461/basic-project-setup---where-to-find-information

    If you're struggling with installing NCS I would highly recommend you to use Toolchain Manager, not the Getting Started Assistant app (GSA). You install it by simply pressing a button, and everything should work out of the box.  It should work fine for Windows, but is not 100% stable for MacOS yet. If you're using Linux, you need to use the GSA.

    Best regards,

    Simon

  • I used the Toolchain Manager to install NCS (not sure what NCS stands for tho) on MacOS and succesfully built applications in Segger Studio using nRF Connect SDK v1.4.2. I only tried sample projects that were selected from within Segger Studio and never from custom folders.

    However, I prefer to use CLI tools, as the rest of our projects are just plain CMake porjects.

  • Thanks for giving it a try. Here are my steps, i just recreated them:

    • Copy  ncs\v1.4.2\nrf\samples\bluetooth\peripheral_lbs\ to any folder (e.g. ~/temp/peripheral_lbs/)
    • open terminal in new folder
    • source /opt/nordic/ncs/v1.4.2/zephyr/zephyr-env.sh
    • west build -b nrf52840dk_nrf52840

    ## Build Output

    ```

    -- west build: generating a build system
    Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.4.2/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs
    -- Using NCS Toolchain 1.4.0 for building. (/opt/nordic/ncs/v1.4.2/toolchain/cmake)
    -- Zephyr version: 2.4.0 (/opt/nordic/ncs/v1.4.2/zephyr)
    -- Found Python3: /opt/nordic/ncs/v1.4.2/toolchain/bin/python3 (found suitable exact version "3.8.2") found components: Interpreter
    -- Found west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Board: nrf52840dk_nrf52840
    -- Cache files will be written to: /Users/larsheinrichs/Library/Caches/zephyr
    -- Found dtc: /opt/nordic/ncs/v1.4.2/toolchain/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.4.2/toolchain)
    -- Found BOARD.dts: /opt/nordic/ncs/v1.4.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/Kconfig
    Loaded configuration '/opt/nordic/ncs/v1.4.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/prj.conf'

    /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/prj.conf:6: warning: attempt to assign the value 'y' to the undefined symbol NCS_SAMPLES_DEFAULTS

    /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/prj.conf:13: warning: attempt to assign the value 'y' to the undefined symbol BT_LBS

    /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/prj.conf:14: warning: attempt to assign the value 'y' to the undefined symbol BT_LBS_POLL_BUTTON

    /Users/larsheinrichs/Workspaces/temporary/peripheral_lbs/prj.conf:15: warning: attempt to assign the value 'y' to the undefined symbol DK_LIBRARY

    error: Aborting due to Kconfig warnings

    CMake Error at /opt/nordic/ncs/v1.4.2/zephyr/cmake/kconfig.cmake:239 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    /opt/nordic/ncs/v1.4.2/zephyr/cmake/app/boilerplate.cmake:591 (include)
    /opt/nordic/ncs/v1.4.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
    /opt/nordic/ncs/v1.4.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    -- Configuring incomplete, errors occurred!

    ```

  • actually, the same happens when i try to build the peripheral_lbs project inside the samples folder. And for other projects, like peripheral_uart or peripheral_hids_keyboard (and probably more).

Related