Using the nRF secure immutable bootloader to update the application core

Hi everyone,

I'm using an nRF 5340-DK and want to update the application core firmware by using the nRF secure immutable bootloader. The bootloader and the network core do not need to be updated.

I used the example project "central_bas" where I added the bootloader by adding "CONFIG_SECURE_BOOT=y" to the prj.conf file. The bootloader works as it gives the expected output to a e.g. Putty console.

Now what I don't unterstand is how to send application firmware images to the bootloader in order to update the application core. I couldn't find any examples in the official nRF Connect SDK documentation. For this I am using nRF Connect SDK v1.9.0.

For testing I tried to program the application core with nrfjprog, but it would give me an error saying that "readback protection" is enabled and I have to flash the complete application core.

What I try to achieve is to send new firmware images to the bootloader, which updates the current firmware on the application core.

Best regards,

Alex

  • Hi Amanda,

    I deleted the entire build folder and reloaded the "central-bas" project, now I get:

    sign(...) missing a required argument: SIGNED_BIN_FILE_IN

    Creating solution central_bas.emProject
    C:/ncs/v1.9.0/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DBOARD_DIR=C:\ncs\v1.9.0\zephyr\boards\arm\nrf5340dk_nrf5340 -BC:\ncs\v1.9.0\nrf\samples\bluetooth\central_bas\build_nrf5340dk_nrf5340_cpuapp -SC:\ncs\v1.9.0\nrf\samples\bluetooth\central_bas -DNCS_TOOLCHAIN_VERSION=1.9.0 -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=C:\ncs\v1.9.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    -- Application: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.0/zephyr), build: v2.7.99-ncs1
    -- Found Python3: C:/ncs/v1.9.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: C:/ncs/v1.9.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.9.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/v1.9.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/prj.conf'
    Configuration saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    loading initial cache file C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.0/zephyr/samples/bluetooth/hci_rpmsg
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.0/zephyr), build: v2.7.99-ncs1
    -- Found Python3: C:/ncs/v1.9.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Cache files will be written to: C:/ncs/v1.9.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.9.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/v1.9.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.0/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration 'C:/ncs/v1.9.0/zephyr/samples/bluetooth/hci_rpmsg/prj.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/bootloader/image/secure_boot.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    loading initial cache file C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.0/nrf/samples/nrf5340/netboot
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.0/zephyr), build: v2.7.99-ncs1
    -- Found Python3: C:/ncs/v1.9.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Cache files will be written to: C:/ncs/v1.9.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.9.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/v1.9.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.0/nrf/samples/nrf5340/netboot/Kconfig
    Loaded configuration 'C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration 'C:/ncs/v1.9.0/nrf/samples/nrf5340/netboot/prj.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Configuration saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n
    -- libmetal version: 1.1.0 (C:/ncs/v1.9.0/zephyr/samples/bluetooth/hci_rpmsg)
    -- Looking for include file stdatomic.h
    -- Looking for include file stdatomic.h - found
    -- open-amp version: 1.1.0 (C:/ncs/v1.9.0/modules/lib/open-amp/open-amp)
    -- Looking for include file fcntl.h
    -- Looking for include file fcntl.h - found
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg
    loading initial cache file C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.0/zephyr), build: v2.7.99-ncs1
    -- Found Python3: C:/ncs/v1.9.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: C:/ncs/v1.9.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.9.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/v1.9.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: C:/ncs/v1.9.0/nrf/modules/mcuboot/usb.overlay
    -- Found devicetree overlay: C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/pcd/pcd.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/bootloader/image/build_s1.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot
    loading initial cache file C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake
    -- Application: C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr
    -- Zephyr version: 2.7.99 (C:/ncs/v1.9.0/zephyr), build: v2.7.99-ncs1
    -- Found Python3: C:/ncs/v1.9.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: C:/ncs/v1.9.0/zephyr/.cache
    -- Found dtc: C:/ncs/v1.9.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/ncs/v1.9.0/toolchain/opt)
    -- Found BOARD.dts: C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: C:/ncs/v1.9.0/nrf/modules/mcuboot/usb.overlay
    -- Found devicetree overlay: C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/dts.overlay
    -- Generated zephyr.dts: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/dts.cmake
    Parsing C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v1.9.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncs/v1.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/pcd/pcd.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/bootloader/image/build_s1.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/s1_image
    -- Configuring incomplete, errors occurred!
    See also "C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/CMakeFiles/CMakeOutput.log".
    See also "C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/CMakeFiles/CMakeError.log".
    Including boilerplate (Zephyr base): C:/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.9.0 for building. (C:/ncs/v1.9.0/toolchain/cmake)
    
    warning: FW_INFO_FIRMWARE_VERSION (defined at C:/ncs/v1.9.0/nrf\subsys\fw_info/Kconfig:23) was
    assigned the value '1' but got the value ''. Check these unsatisfied dependencies: FW_INFO (=n). See
    http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_FW_INFO_FIRMWARE_VERSION.html and/or
    look up FW_INFO_FIRMWARE_VERSION in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    
    warning: BOOT_SIGNATURE_KEY_FILE (defined at C:/ncs/v1.9.0/nrf/modules/mcuboot/Kconfig:3) was
    assigned the value 'priv.pem' but got the value ''. Check these unsatisfied dependencies:
    (!MCUBOOT_BUILD_STRATEGY_FROM_SOURCE) (=n). See
    http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOT_SIGNATURE_KEY_FILE.html and/or
    look up BOOT_SIGNATURE_KEY_FILE in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    C:\ncs\v1.9.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    
    === child image hci_rpmsg - CPUNET begin ===
    CMake Warning (dev) at C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/child_image_preload.cmake:11 (set):
      Syntax error in cmake code at
    
        C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/child_image_preload.cmake:11
    
      when parsing string
    
        C:\ncs\v1.9.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    
      Invalid escape sequence \v
    
      Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
      "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    Including boilerplate (Zephyr base): C:/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.9.0 for building. (C:/ncs/v1.9.0/toolchain/cmake)
    C:\ncs\v1.9.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    
    === child image b0n - CPUNET (inherited) begin ===
    CMake Warning (dev) at C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/child_image_preload.cmake:11 (set):
      Syntax error in cmake code at
    
        C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/hci_rpmsg/b0n/child_image_preload.cmake:11
    
      when parsing string
    
        C:\ncs\v1.9.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    
      Invalid escape sequence \v
    
      Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
      "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    Including boilerplate (Zephyr base): C:/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.9.0 for building. (C:/ncs/v1.9.0/toolchain/cmake)
    C:\ncs\v1.9.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    CMake Warning at C:/ncs/v1.9.0/zephyr/CMakeLists.txt:1687 (message):
      __ASSERT() statements are globally ENABLED
    
    
    === child image b0n - CPUNET (inherited) end ===
    
    -- Build type:  
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    === child image hci_rpmsg - CPUNET end ===
    
    
    === child image mcuboot -  begin ===
    CMake Warning (dev) at C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake:9 (set):
      Syntax error in cmake code at
    
        C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake:9
    
      when parsing string
    
        C:\ncs\v1.9.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    
      Invalid escape sequence \v
    
      Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
      "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    Including boilerplate (Zephyr base): C:/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.9.0 for building. (C:/ncs/v1.9.0/toolchain/cmake)
    C:\ncs\v1.9.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    MCUBoot bootloader key file: C:/ncs/v1.9.0/bootloader/mcuboot/root-rsa-2048.pem
    === child image mcuboot -  end ===
    
    
    === child image s1_image -  begin ===
    CMake Warning (dev) at C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake:9 (set):
      Syntax error in cmake code at
    
        C:/ncs/v1.9.0/nrf/samples/bluetooth/central_bas/build_nrf5340dk_nrf5340_cpuapp/mcuboot/child_image_preload.cmake:9
    
      when parsing string
    
        C:\ncs\v1.9.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    
      Invalid escape sequence \v
    
      Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
      "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    Including boilerplate (Zephyr base): C:/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake
    -- Using NCS Toolchain 1.9.0 for building. (C:/ncs/v1.9.0/toolchain/cmake)
    C:\ncs\v1.9.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    MCUBoot bootloader key file: C:/ncs/v1.9.0/bootloader/mcuboot/root-rsa-2048.pem
    === child image s1_image -  end ===
    
    CMake Warning at C:/ncs/v1.9.0/nrf/modules/mcuboot/CMakeLists.txt:262 (message):
      
    
            ---------------------------------------------------------
            --- WARNING: Using default MCUBoot key, it should not ---
            --- be used for production.                           ---
            ---------------------------------------------------------
            
    
    
    
    CMake Error at C:/ncs/v1.9.0/nrf/cmake/extensions.cmake:42 (message):
      sign(...) missing a required argument: SIGNED_BIN_FILE_IN
    Call Stack (most recent call first):
      C:/ncs/v1.9.0/nrf/modules/mcuboot/CMakeLists.txt:47 (check_arguments_required_all)
      C:/ncs/v1.9.0/nrf/modules/mcuboot/CMakeLists.txt:451 (sign)
    
    
    
    error: cmake failed
    create_nordic_project.py failed (1)

    When building without "CONFIG_BUILD_S1_VARIANT", everything worked fine.

    Best regards,

    Alex

  • Hi, 

    Can you provide the prj.conf?

    I cannot reproduce the issue to build the NCS v1.9.0 "central-bas" project with VScode or west using the following command. 

    west build -b nrf5340dk_nrf5340_cpuapp  -- -DCONFIG_SECURE_BOOT=y -DCONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_BUILD_S1_VARIANT=y

    Maybe you can run the "update SDK" in the Tool Manager and then reload the project. 

    -Amand

  • Hi,

    my prj.conf file contains the following lines:

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_SMP=y
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=1024
    CONFIG_BT_BAS_CLIENT=y
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    CONFIG_BT_PRIVACY=y
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    CONFIG_DK_LIBRARY=y
    
    # Changed for bootloader
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_BOOT_SIGNATURE_KEY_FILE="privMCUBoot.pem"
    CONFIG_MCUBOOT_IMAGE_VERSION="2"
    CONFIG_BUILD_S1_VARIANT=y

    I added "CONFIG_SECURE_BOOT=y" and with this, the build went through.

    Do you have an idea why it wouldn't work withouth CONFIG_SECURE_BOOT?

    Now everytime I connect my board in Segger Embedded Studio I get the (expected) warning "This device is secured. Unsecuring will trigger a mass erase of the internal flash, SRAM and UICR of both the application and network core."

    I also get this, when flashing with e.g. nrfjprog.

    If I now build a new version of my firmware, how do I get the app_update.bin onto my board without erasing the whole flash?

    Best regards,

    Alex

  • See my colleague's answer in your post

    Please don't create duplicated case for the same questions. 

    -Amanda

Related