NRF samples don't work on sdk v2.1.0

I'm working with NCS v2.1.0 and Visual Studio Code, I tried to build nrf/samples/bootloader but always:

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

I can run all other  samples on zephyr/samples without issues, not sure if a missed of something or some configuration to allow CMakeList.txt or Kconfig definitions in sdkv2.1.0/nrf/ folder or maybe it is not allowed to use those definitions anymore, what am I doing wrong?, thanks.

  • Hello JMA,

    My initial guess is that your prj.conf file has been changed. That is, IS_SECURE_BOOTLOADER is not a symbol in the nrf/samples/bootloader sample, but CONFIG_IS_SECURE_BOOTLOADER is part of it.

    Are you able to build the sample it you replace IS_SECURE_BOOTLOADER with CONFIG_IS_SECURE_BOOTLOADER?

    Kind Regards,
    Maria

  • Hi Maria, it is not my prj.conf, it is the example one :

    I just go to Create a new application->Application template-browse->nrf/samples/bootloader->select->Create Application->build

    Visual Studio Code version: 1.72.2 (user setup)

    NRF Connect for VS Code v2022.10.30

  • Hello,

    JMA said:

    Visual Studio Code version: 1.72.2 (user setup)

    NRF Connect for VS Code v2022.10.30

    I have the same versions, so this should be ok.

    Q1: How have you installed NCS v2.1.0? With the Toolchain Manager or manually?

    I can run all other  samples on zephyr/samples without issues

    I read through your original post, and took note of this.
    Q2: Are you able to build any samples in nrf/samples or only from zephyr/samples?

    Below is the prj.conf which is included with my installation of NCS v2.1.0. I am able to build the sample with no errors.
    Q3: Does the prj.conf for the bootloader sample look the same as mine?

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_IS_SECURE_BOOTLOADER=y
    CONFIG_MULTITHREADING=n
    CONFIG_GPIO=n
    CONFIG_ARM_MPU=n
    CONFIG_PM=n
    CONFIG_TICKLESS_KERNEL=n
    CONFIG_ERRNO=n
    CONFIG_FPROTECT=y
    CONFIG_SECURE_BOOT_CRYPTO=y
    CONFIG_SECURE_BOOT_DEBUG=y
    CONFIG_SECURE_BOOT_VALIDATION=y
    CONFIG_SECURE_BOOT_STORAGE=y
    CONFIG_BL_ROT_VERIFY_EXT_API_ENABLED=y
    CONFIG_BL_SHA256_EXT_API_ENABLED=y
    CONFIG_BL_SECP256R1_EXT_API_ENABLED=y
    CONFIG_BL_VALIDATE_FW_EXT_API_ENABLED=y
    CONFIG_EXT_API_PROVIDE_EXT_API_ENABLED=y
    CONFIG_NRFX_NVMC=y
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_TIMEOUT_64BIT=n
    
    # Disable asserts because of false positive when writing to OTP.
    CONFIG_ASSERT=n
    
    # Avoid triggering IRQs from the RTC
    CONFIG_NRF_RTC_TIMER=n
    

    If it is not the same, please make the necessary changes so that they are identical.

    Kind Regards,
    Maria

  • Hi, It is my first time with NCS, I followed the steps Nordic has in its course, I can run all examples in zephyr/samples and not  the ones in nrf/samples.

    Obviously, if it is working for you, then I have something wrong with my installation.

    Ill take a look and maybe reinstalling everything again, maybe something with west or toolchain?

    .west/config

    [manifest]
    path = zephyr
    file = west.yml

    [zephyr]
    base = zephyr

    zephyr/west.yml

    # The west manifest file for upstream Zephyr.
    #
    # The per-installation west configuration file, .west/config, sets the
    # path to the project containing this file in the [manifest] section's
    # "path" variable.
    #
    # You are free to create your own manifest files and put them in any
    # repository you want, to create your own custom Zephyr installations.
    # For example, you could create a manifest file in your own out of
    # tree application directory, which would pull this zephyr repository
    # in as an ordinary project.
    #
    # You can pass your manifest repositories to west init when creating a
    # new Zephyr installation. See the west documentation for more
    # information.

    manifest:
      defaults:
        remote: upstream

      remotes:
        - name: upstream
          url-base: github.com/zephyrproject-rtos

      #
      # Please add items below based on alphabetical order
      projects:
        - name: canopennode
          revision: 53d3415c14d60f8f4bfca54bfbc5d5a667d7e724
          path: modules/lib/canopennode
        - name: chre
          revision: ef76d3456db07e4959df555047d6962279528c8d
          path: modules/lib/chre
        - name: cmsis
          revision: 5f86244bad4ad5a590e084f0e72ba7a1416c2edf
          path: modules/hal/cmsis
          groups:
            - hal
        - name: edtt
          revision: 1ea61a390d2bfcf3b2ecdba8f8b0b98dfdffbd11
          path: tools/edtt
          groups:
            - tools
        - name: fatfs
          revision: a30531af3a95a9a3ea7d771ea8a578ebfed45514
          path: modules/fs/fatfs
          groups:
            - fs
        - name: fff
          revision: 6ce5ba26486e93d5b7696a3e23f0585932c14b16
          path: modules/lib/fff
          groups:
            - ci
        - name: hal_altera
          revision: 0d225ddd314379b32355a00fb669eacf911e750d
          path: modules/hal/altera
          groups:
            - hal
        - name: hal_atmel
          revision: bb4e7104132bdc22c7cc7e20057434c2979e6706
          path: modules/hal/atmel
          groups:
            - hal
        - name: hal_espressif
          revision: 3f05902c85ecc43c790f2f0239483cc26eb4a8e2
          path: modules/hal/espressif
          west-commands: west/west-commands.yml
          groups:
            - hal
        - name: hal_gigadevice
          revision: 7f15468b07807ae6a913e0e9cbabfaa23a206bc6
          path: modules/hal/gigadevice
          groups:
            - hal
        - name: hal_infineon
          revision: 4af06965f57ba1e7d170e6a97d24c33785543a8c
          path: modules/hal/infineon
          groups:
            - hal
        - name: hal_microchip
          revision: 5d079f1683a00b801373bbbbf5d181d4e33b30d5
          path: modules/hal/microchip
          groups:
            - hal
        - name: hal_nordic
          revision: f6628a30581d8d4b80954af163b83ce065e87467
          path: modules/hal/nordic
          groups:
            - hal
        - name: hal_nuvoton
          revision: b4d31f33238713a568e23618845702fadd67386f
          path: modules/hal/nuvoton
          groups:
            - hal
        - name: hal_nxp
          revision: 00acb97521c171f4620c21fe5fa2a2c3ef49bdae
          path: modules/hal/nxp
          groups:
            - hal
        - name: hal_openisa
          revision: 40d049f69c50b58ea20473bee14cf93f518bf262
          path: modules/hal/openisa
          groups:
            - hal
        - name: hal_quicklogic
          revision: b3a66fe6d04d87fd1533a5c8de51d0599fcd08d0
          path: modules/hal/quicklogic
          repo-path: hal_quicklogic
          groups:
            - hal
        - name: hal_rpi_pico
          path: modules/hal/rpi_pico
          revision: 191f5ba46fda49523cdaaef27583d1c875ba2c36
          groups:
            - hal
        - name: hal_silabs
          revision: 1ec8dd99aa4ac3e8632d2aa28a7438049bb27102
          path: modules/hal/silabs
          groups:
            - hal
        - name: hal_st
          revision: 52a522ca4a8a9ec1e9bb5bb514e1ab6f102863fe
          path: modules/hal/st
          groups:
            - hal
        - name: hal_stm32
          revision: 51b373cd3455b8c2b9babbf6ff41918116a442ac
          path: modules/hal/stm32
          groups:
            - hal
        - name: hal_telink
          revision: 38573af589173259801ae6c2b34b7d4c9e626746
          path: modules/hal/telink
          submodules: true
          groups:
            - hal
        - name: hal_ti
          revision: 29af528900d03af02a17b4b7f4fc93f19a81da2a
          path: modules/hal/ti
          groups:
            - hal
        - name: hal_xtensa
          revision: 63f655362423aa49507da7977a2d37142e8debeb
          path: modules/hal/xtensa
          groups:
            - hal
        - name: libmetal
          revision: 2f586b4f1276fb075ee145421bdf6cbe5403aa41
          path: modules/hal/libmetal
          groups:
            - hal
        - name: liblc3codec
          revision: 3951cf1b71ff3be086c9b9b595e473e12301337c
          path: modules/lib/liblc3codec
        - name: littlefs
          path: modules/fs/littlefs
          groups:
            - fs
          revision: 652f2c5646e79b881e6f3099686ad3b7af9e216c
        - name: loramac-node
          revision: 0257b50905695192d095667b1c3abb80346db1a1
          path: modules/lib/loramac-node
        - name: lvgl
          revision: 487bcde705b6f453d053f28dbba4dd9f353d1ccb
          path: modules/lib/gui/lvgl
        - name: lz4
          revision: 8e303c264fc21c2116dc612658003a22e933124d
          path: modules/lib/lz4
        - name: mbedtls
          revision: 7fed49c9b9f983ad6416986661ef637459723bcb
          path: modules/crypto/mbedtls
          groups:
            - crypto
        - name: mcuboot
          revision: 1d4404116a9a6b54d54ea9aa3dd2575286e666cd
          path: bootloader/mcuboot
        - name: mipi-sys-t
          path: modules/debug/mipi-sys-t
          groups:
            - debug
          revision: a5163c1800a5243f8b05d84c942da008df4cb666
        - name: nanopb
          revision: dc4deed54fd4c7e1935e3b6387eedf21bb45dc38
          path: modules/lib/nanopb
        - name: net-tools
          revision: e0828aa9629b533644dc96ff6d1295c939bd713c
          path: tools/net-tools
          groups:
            - tools
        - name: nrf_hw_models
          revision: 93406267eca506003bcb86a86927777a32e729d9
          path: modules/bsim_hw_models/nrf_hw_models
        - name: open-amp
          revision: 8d53544871e1f300c478224faca6be8384ab0d04
          path: modules/lib/open-amp
        - name: openthread
          revision: b21e99b4b3d823f71c902b9174ff62b964c124f0
          path: modules/lib/openthread
        - name: picolibc
          path: modules/lib/picolibc
          revision: e87b2fc37345a62361478f0a6efd140e14180ba5
        - name: segger
          revision: d4e568a920b4bd087886170a5624c167b2d0665e
          path: modules/debug/segger
          groups:
            - debug
        - name: sof
          revision: fed466c264ad078c66f7bff9218ba1d3fa0eb201
          path: modules/audio/sof
        - name: tflite-micro
          revision: 9156d050927012da87079064db59d07f03b8baf6
          path: modules/lib/tflite-micro
          repo-path: tflite-micro
        - name: tinycbor
          revision: 9e1f34bc08123aaad7666d3652aaa839e8178b3b
          path: modules/lib/tinycbor
        - name: tinycrypt
          revision: 3e9a49d2672ec01435ffbf0d788db6d95ef28de0
          path: modules/crypto/tinycrypt
          groups:
            - crypto
        - name: TraceRecorderSource
          revision: 9893bf1cf649a2c4ee2e27293f887994f3d0da5b
          path: modules/debug/TraceRecorder
          groups:
            - debug
        - name: trusted-firmware-m
          revision: f13209f1883232cbcb9f0c31fb4c63e7c242df0d
          path: modules/tee/tf-m/trusted-firmware-m
          groups:
            - tee
        - name: tf-m-tests
          revision: c99a86b295c4887520da9d8402566d7f225c974e
          path: modules/tee/tf-m/tf-m-tests
          groups:
            - tee
        - name: psa-arch-tests
          revision: f4fc2442b8e29e2a03d9899e46e5a3ea3df8c2c9
          path: modules/tee/tf-m/psa-arch-tests
          groups:
            - tee
        - name: zcbor
          revision: a0d6981f14d4001d6f0d608d1a427f9bc6bb6d02
          path: modules/lib/zcbor
        - name: zscilib
          path: modules/lib/zscilib
          revision: a54986aa98db4082ac56b582843bb5b5435208a6

      group-filter:
        - -ci

      self:
        path: zephyr
        west-commands: scripts/west-commands.yml
        import: submanifests

    toolchains: environment.json

    {
      "env_vars": [
        {
          "type": "relative_paths",
          "key": "PATH",
          "values": [
            ".",
            "mingw64/bin",
            "bin",
            "opt/bin",
            "opt/bin/Scripts",
            "nanopb/generator-bin",
            "opt/zephyr-sdk/arm-zephyr-eabi/bin"
          ],
          "existing_value_treatment": "prepend_to"
        },
        {
          "type": "relative_paths",
          "key": "PYTHONPATH",
          "values": [
            "opt/bin",
            "opt/bin/Lib",
            "opt/bin/Lib/site-packages"
          ],
          "existing_value_treatment": "overwrite"
        },
        {
          "type": "relative_paths",
          "key": "ZEPHYR_SDK_INSTALL_DIR",
          "values": [
            "opt/zephyr-sdk"
          ],
          "existing_value_treatment": "overwrite"
        }
      ]
    }

  • Ok, so knowing it must work(thanks Maria), I was looking at West Integration: https://nrfconnect.github.io/vscode-nrf-connect/connect/west.html

    and I did :

    and now I can create app with nrf/samples/bootloader and acces to symbol:

    CONFIG_IS_SECURE_BOOTLOADER=y
Related