FOTA - BLE: Custom Keys issue on compilation

Hello,

I've recently upgraded my pre-production application on nrf52832 from NCS v2.6.2 to Ncs v3.0.1 also upgraded to HWv2(on interim ncs 2.9.0 as adding custom board for me didn't work on NCS v3.0.1 - Will explain this issue on This thread : Here 

Setup: 
custom HArdware Nrf52832 Raytac Module.
Ncs v3.0.1SDK with 3.0.1 Toolchain

Note ncs v3.0.1: I've just tried the default LBS example on nrf52dk with FOTA & it works well.

I want to add my custom-generated key for FOTA security. followed "Dev academy tutorial" as well as this page: https://docs.nordicsemi.com/bundle/ncs-3.0.0/page/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_adding_sysbuild.html 

I followed this link, OPENSS,L to generate the custom key as mentioned : https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_signature_keys.html
But I'm getting this issue on the terminal while compiling, and my custom keys seem to be getting rejected. 


My objective: 

1) Would like to use an Upgradable Bootloader, but when I enabled the sysbuild configs, I'm just getting errors (refer screen shoot - hence I've only attached the fully compiling configuration & it's logs here in this thread)

2) I would like to implement the custom private key solution. 

My Issues:
1)  secure_boot = n (warning on terminal) -( MCUBoot bootloader key file: C:/ncs/v3.0.1/bootloader/mcuboot/root-rsa-2048.pem
CMake Warning at CMakeLists.txt:393 (message):
WARNING: Using default MCUboot signing key file, this file is for debug use
only and is not secure!)

2) warning: Deprecated symbol DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled. (How to solve this?)

3) warning: Deprecated symbol BT_CTLR is enabled (how to solve this?)

4) When I run west update (technically I'm not using the wested workspace though) on ncsv3.0.1, I'm getting issues on old SDK v2.6.2, not found error on the terminal. (see screenshot attached.)






Need Assistance here. Thanks in advance for your help.

Parents
  • Hi,

    I followed this link, OPENSS,L to generate the custom key as mentioned

    It is a good idea to also try the alternatives:
    Does it work if you use imgtool instead?

    It is a good idea to try a working sample:
    Do you get the same error with the solution?

    1)  secure_boot = n (warning on terminal) -( MCUBoot bootloader key file: C:/ncs/v3.0.1/bootloader/mcuboot/root-rsa-2048.pem
    CMake Warning at CMakeLists.txt:393 (message):
    WARNING: Using default MCUboot signing key file, this file is for debug use
    only and is not secure!)

    How do you add the configuration for the custom key?

    2) warning: Deprecated symbol DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled. (How to solve this?)

    3) warning: Deprecated symbol BT_CTLR is enabled (how to solve this?)

    This is with your project, right? Or do you use a sample?

    4) When I run west update (technically I'm not using the wested workspace though) on ncsv3.0.1, I'm getting issues on old SDK v2.6.2, not found error on the terminal. (see screenshot attached.)

    What install method have you used for the nRF connect SDK?

    Regards,
    Sigurd Hellesvik

  • Hello,

    Does it work if you use imgtool instead?

    Unfortunately for me, no..imgtool didn't work, some errors.

    It is a good idea to try a working sample:
    Do you get the same error with the solution?

    My sample is based on the LBS sample under NCS 2.6.2. Just to be sure, I did this: (for the moment, let's forget my custom project)

    My new try is as follows:
    1) Under the new folder, I copied the sample LBS sample ncsv3.0.1
    2) Just added FOTA support based on DEVacademy tutorial & compiled it, it works on 52dk (As default key)
    3) An error occurs when I just added my custom FOTA key. Unable to build.

    logs: 

    Building BLE
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/Nordic/Software/BLE/build c:/Nordic/Software/BLE --pristine --board nrf52dk/nrf52832 --sysbuild -- -DCONF_FILE=prj.conf -DCONFIG_SIZE_OPTIMIZATIONS=y -DBOARD_ROOT=c:/nordic/software/ble;c:/nordic/software/ble_ncs/application"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    Parsing c:/Nordic/Software/BLE/Kconfig.sysbuild
    Loaded configuration 'C:/Nordic/Software/BLE/build/_sysbuild/empty.conf'
    Merged configuration 'c:/Nordic/Software/BLE/sysbuild.conf'
    Configuration saved to 'C:/Nordic/Software/BLE/build/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/mcuboot/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/mcuboot/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v3.0.1/nrf/subsys/bootloader/image/log_minimal.conf'
    Merged configuration 'C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/external_crypto.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    MCUBoot bootloader key file: C:/ncs/v3.0.1/bootloader/mcuboot/root-ec-p256.pem
    CMake Warning at CMakeLists.txt:393 (message):
      WARNING: Using default MCUboot signing key file, this file is for debug use
      only and is not secure!
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Nordic/Software/BLE/build/mcuboot
    -- 
       ************************
       * Running CMake for b0 *
       ************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3.0.1/nrf/samples/bootloader
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/b0/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/b0/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/b0/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/b0/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/b0/zephyr/dts.cmake
    
    warning: HW_STACK_PROTECTION (defined at
    C:/ncs/v3.0.1/zephyr/soc/nxp/s32\s32k1\Kconfig.defconfig:20, arch/Kconfig:284) was assigned the
    value 'y' but got the value 'n'. Check these unsatisfied dependencies: ((SOC_SERIES_S32K1 &&
    SOC_FAMILY_NXP_S32) || ARCH_HAS_STACK_PROTECTION) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_HW_STACK_PROTECTION and/or look up
    HW_STACK_PROTECTION 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.
    
    Parsing C:/ncs/v3.0.1/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v3.0.1/nrf/samples/bootloader/prj.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/b0/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Nordic/Software/BLE/build/b0/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/b0/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Nordic/Software/BLE/build/b0
    -- 
       *************************
       * Running CMake for BLE *
       *************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Nordic/Software/BLE
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/BLE/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/BLE/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/BLE/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/BLE/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/BLE/zephyr/dts.cmake
    Parsing C:/Nordic/Software/BLE/Kconfig
    Loaded configuration 'C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/Nordic/Software/BLE/prj.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/BLE/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/BLE/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Nordic/Software/BLE/build/BLE/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/BLE/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    =========== Generating psa_crypto_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_config ===============
    =========== Generating psa_crypto_library_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_library_config ===============
    -- Including signing script: C:/ncs/v3.0.1/nrf/cmake/sysbuild/image_signing.cmake
    CMake Warning at C:/ncs/v3.0.1/zephyr/CMakeLists.txt:2180 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Nordic/Software/BLE/build/BLE
    -- 
       ******************************
       * Running CMake for s1_image *
       ******************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/ncs/v3.0.1/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/s1_image/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/s1_image/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/s1_image/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/s1_image/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/s1_image/zephyr/dts.cmake
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    MCUBoot bootloader key file: C:/ncs/v3.0.1/bootloader/mcuboot/root-ec-p256.pem
    CMake Warning at CMakeLists.txt:393 (message):
      WARNING: Using default MCUboot signing key file, this file is for debug use
      only and is not secure!
    
    
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        EXTRA_KCONFIG_TARGETS
        FORCED_CONF_FILE
    
    
    -- Build files have been written to: C:/Nordic/Software/BLE/build/s1_image
    CMake Error at C:/ncs/v3.0.1/nrf/cmake/sysbuild/debug_keys.cmake:66 (message):
      Config points to non-existing PEM file
      'C:NordicSoftwareBLEFOTA-KeysFOTA-Private-Key-ECDSA-P256.pem'
    Call Stack (most recent call first):
      C:/ncs/v3.0.1/nrf/cmake/sysbuild/provision_hex.cmake:11 (include)
      C:/ncs/v3.0.1/nrf/sysbuild/CMakeLists.txt:55 (include)
      C:/ncs/v3.0.1/nrf/sysbuild/CMakeLists.txt:739 (include_provision_hex)
      cmake/modules/sysbuild_extensions.cmake:583 (nrf_POST_CMAKE)
      cmake/modules/sysbuild_extensions.cmake:583 (cmake_language)
      cmake/modules/sysbuild_images.cmake:46 (sysbuild_module_call)
      cmake/modules/sysbuild_default.cmake:21 (include)
      C:/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v3.0.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Nordic/Software/BLE/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe '-Bc:\Nordic\Software\BLE\build' -GNinja -DBOARD=nrf52dk/nrf52832 -DCONF_FILE=prj.conf -DCONFIG_SIZE_OPTIMIZATIONS=y '-DBOARD_ROOT=c:/nordic/software/ble;c:/nordic/software/ble_ncs/application' '-SC:\ncs\v3.0.1\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\Nordic\Software\BLE'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    



    This is with your project, right? Or do you use a sample?

    Yes, this is with my specific sample only. Let's say, for the bigger fish to fry for the moment, we shall solve the custom key issue, I guess. Then, if needed, I shall create another ticket specific to this.

    What install method have you used for the nRF connect SDK?

    directly installed from VS Code (manage SDK option, pre-packaged file)

  • The error in your logs say "Config points to non-existing PEM file
      'C:NordicSoftwareBLEFOTA-KeysFOTA-Private-Key-ECDSA-P256.pem'"

    Looks like the file is not found. Try to use the full path to the file instead.

    Also, Windows is known to have some issues with path lengths, so try to use a smaller key name.

    Can you show me the exact line where you configure the key?

  • hello,
    yes i'm using Full path only in sysbuild.conf

    like this 

    SB_CONFIG_SECURE_BOOT_APPCORE=y
    SB_CONFIG_SECURE_BOOT_SIGNING_KEY_FILE="C:\Nordic\Software\BLE\FOTA-Keys\FOTA-Private-Key-ECDSA-P256.pem"

    so try to use a smaller key name.

    Tried this as well but no effect!



    Also added this under cmakelist.txt (example on my original project.)

Reply Children
  • Ah I thought this was the key for MCUboot, and not for NSIB.

    I see now that it is for NSIb.

    In this case, can you try to set the MCUboot key instead: SB_CONFIG_BOOT_SIGNATURE_KEY_FILE.

    Does this fail as well?
    This is a good test to see if it is a CMake can not find the file, or if the issue is specific to the NSIB option.

  • Hello

    In this case, can you try to set the MCUboot key instead: SB_CONFIG_BOOT_SIGNATURE_KEY_FILE.

    yes this fails as well. tried it on both my personal project & the 52DK LBS project as well.

    logs: 

     *  Executing task: nRF Connect: Build [pristine]: BLE/build (active) 
    
    Building BLE
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir c:/Nordic/Software/BLE/build c:/Nordic/Software/BLE --pristine --board p1br2/nrf52832 --sysbuild -- -DCONF_FILE=prj.conf -DCONFIG_SIZE_OPTIMIZATIONS=y -DBOARD_ROOT=c:/nordic/software/ble"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: p1br2, qualifiers: nrf52832
    Parsing c:/Nordic/Software/BLE/Kconfig.sysbuild
    Loaded configuration 'C:/Nordic/Software/BLE/build/_sysbuild/empty.conf'
    Merged configuration 'c:/Nordic/Software/BLE/sysbuild.conf'
    Configuration saved to 'C:/Nordic/Software/BLE/build/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: p1br2, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/Nordic/Software/BLE/boards/p1br2/p1br2.dts
    -- Found devicetree overlay: C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/mcuboot/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/mcuboot/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/mcuboot/zephyr/dts.cmake
    
    warning: Deprecated symbol DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled.
    
    Parsing C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/Nordic/Software/BLE/boards/p1br2/p1br2_defconfig'
    Merged configuration 'C:/ncs/v3.0.1/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/Nordic/Software/BLE/sysbuild/mcuboot.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    MCUBoot bootloader key file: C:NordicSoftwareBLEFOTA-KeysPrivateECDSA256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Nordic/Software/BLE/build/mcuboot
    -- 
       *************************
       * Running CMake for BLE *
       *************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Nordic/Software/BLE
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v3.0.1/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: p1br2, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/0b393f9e1b/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: C:/Nordic/Software/BLE/boards/p1br2/p1br2.dts
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/BLE/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Nordic/Software/BLE/build/BLE/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/Nordic/Software/BLE/build/BLE/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/Software/BLE/build/BLE/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/Software/BLE/build/BLE/zephyr/dts.cmake
    
    warning: Deprecated symbol DEPRECATED_UART_NRFX_UARTE_LEGACY_SHIM is enabled.
    
    Parsing C:/Nordic/Software/BLE/Kconfig
    Loaded configuration 'C:/Nordic/Software/BLE/boards/p1br2/p1br2_defconfig'
    Merged configuration 'C:/Nordic/Software/BLE/prj.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/BLE/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration 'C:/Nordic/Software/BLE/build/BLE/zephyr/.config.sysbuild'
    Configuration saved to 'C:/Nordic/Software/BLE/build/BLE/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/Software/BLE/build/BLE/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    =========== Generating psa_crypto_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_config ===============
    =========== Generating psa_crypto_library_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: True
    =========== End psa_crypto_library_config ===============
    -- Including signing script: C:/ncs/v3.0.1/nrf/cmake/sysbuild/image_signing.cmake
    CMake Error at C:/ncs/v3.0.1/nrf/cmake/sysbuild/image_signing.cmake:45 (message):
      west sign can't find file C:NordicSoftwareBLEFOTA-KeysPrivateECDSA256.pem
      (Note: Relative paths are relative to the west workspace topdir
      "C:/ncs/v3.0.1")
    Call Stack (most recent call first):
      C:/ncs/v3.0.1/nrf/cmake/sysbuild/image_signing.cmake:239 (zephyr_mcuboot_tasks)
      C:/ncs/v3.0.1/zephyr/CMakeLists.txt:2040 (include)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Nordic/Software/BLE/build/BLE/CMakeFiles/CMakeOutput.log".
    See also "C:/Nordic/Software/BLE/build/BLE/CMakeFiles/CMakeError.log".
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: BLE
    
      Location: C:/Nordic/Software/BLE
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      C:/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v3.0.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v3.0.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Nordic/Software/BLE/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe '-Bc:\Nordic\Software\BLE\build' -GNinja -DBOARD=p1br2/nrf52832 -DCONF_FILE=prj.conf -DCONFIG_SIZE_OPTIMIZATIONS=y -DBOARD_ROOT=c:/nordic/software/ble '-SC:\ncs\v3.0.1\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\Nordic\Software\BLE'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

Related