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?

Parents Reply Children
  • 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.

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

  • If the same thing happens when you build the peripheral_lbs inside its initial location (nrf\samples\bluetooth\peripheral_lbs\CMakeLists.txt) that might signify that there is something wrong with your setup, the Toochain Manager should set up everything for you and it should build out-of-the-box. 

    Let's see what happens if you use the command prompt that comes with the Toolchain Manager. Could you try the following:

    • Open the command prompt through the Toolchain Manager (don't use v1.4.99-dev1 as in the image below, use v1.4.2 instead)

    • Redirect to /opt/nordic/ncs/v1.4.2/nrf/samples/bluetooth/peripheral_lbs and build the sample
      • Don't set the Zephyr Base or run zephyr\zephyr-env.cmd. The Toolchain Manager will set up everything for you.

    If it fails, could you upload the build log?

  • Building the example from CLI this way worked, if I build inside the samples folders.

    On trying to build from custom folders (copies of samples), west does not know how to `build`.

  • Could you try to update to the latest Toolchain Manager (TM):

    I got a colleague with a Mac to test the steps you mentioned (using Toolchain Manager v0.9.1)

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

    and it built without problems.

    Try to update the TM and see if it works then. I not, please get back to me.

Related