Fail to boot after upgrade to NCS 3.1.1

We have a NCS 3.0.2 app + MCU boot with OTA functionality on nRF54L15 (PCA10156 rev 0.9.3)

After upgrading to NCS 3.1.1 it doesn't boot anymore.

*** Booting MCUboot v2.1.0-dev-9b4ae4cbc9e2 ***
*** Using nRF Connect SDK v3.1.1-e2a97fe2578a ***
*** Using Zephyr OS v4.1.99-ff8f0c579eeb ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x14000
I: Image version: v0.1.4
I: Jumping to the first image slot
E: Protect mcuboot flash failed, cancel startup.

I tried with

nrfjprog --recover
west build --pristine -b nrf54l15dk/nrf54l15/cpuapp/ns --sysbuild x:/path/to/project
Flash
west ncs-provision upload -s nrf54l15 -k pk.pem
Reboot

Key provisioning is successful. But I get the same error as above. 

After downgrade to NCS 3.0.2 it works again, so the problem is obviously related to upgrade NCS 3.1.1
So, what is wrong? How to fix this?

Parents Reply Children
  • Thanks. I went and tested 3.2.0-rc2 and it seems to work. However if i define fprotect (CONFIG_FPROTECT=y) in my prj.conf i get rramc errors. It seems that the reason is that i am building a non secure application. Can you confirm if this is true.

    If i remove the fprotect declaration everything builds fine. I am attaching the build log of where it failed:

    [261/371] Building C object modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c.obj
    FAILED: modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c.obj
    C:\ncs\toolchains\66cdf9b75e\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=1024 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"n
    rf-psa-crypto-config.h\" -DNCS_APPLICATION_BOOT_BANNER_GIT_REPO -DNRF54L15_XXAA -DNRF_APPLICATION -DNRF_CONFIG_CPU_FREQ_MHZ=128 -DNRF_DISABLE_FICR_TRIMCNF -DNRF_SKIP_CLOCK_CONFIGURATION -DNRF_SKIP_GLI
    TCHDETECTOR_DISABLE -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -DZCBOR_ASSERTS -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v3.2.0-rc2
    /nrf/drivers/mpsl/clock_control -IC:/Users/SV/Documents/smartcup/build/smartcup/zephyr/include/generated/zephyr -IC:/ncs/v3.2.0-rc2/zephyr/include -IC:/Users/SV/Documents/smartcup/
    build/smartcup/zephyr/include/generated -IC:/ncs/v3.2.0-rc2/zephyr/soc/nordic -IC:/ncs/v3.2.0-rc2/zephyr/soc/nordic/nrf54l/. -IC:/ncs/v3.2.0-rc2/zephyr/soc/nordic/common/. -IC:/ncs/v3.2.0-rc2/zephyr/s
    ubsys/mgmt/mcumgr/util/include -IC:/ncs/v3.2.0-rc2/bootloader/mcuboot/boot/bootutil/include -IC:/ncs/v3.2.0-rc2/zephyr/subsys/mgmt/mcumgr/transport/include -IC:/ncs/v3.2.0-rc2/zephyr/subsys/bluetooth
    -IC:/ncs/v3.2.0-rc2/zephyr/subsys/settings/include -IC:/ncs/v3.2.0-rc2/nrf/include -IC:/ncs/v3.2.0-rc2/nrf/lib/multithreading_lock/. -IC:/ncs/v3.2.0-rc2/nrf/subsys/bluetooth/controller/. -IC:/Users/Si
    monVukadin/Documents/smartcup/build/smartcup/tfm/api_ns/interface/include -IC:/ncs/v3.2.0-rc2/nrf/subsys/settings/include -IC:/ncs/v3.2.0-rc2/nrf/modules/trusted-firmware-m/. -IC:/ncs/v3.2.0-rc2/nrf/i
    nclude/tfm -IC:/ncs/v3.2.0-rc2/zephyr/drivers/flash -IC:/ncs/v3.2.0-rc2/nrf/tests/include -IC:/ncs/v3.2.0-rc2/modules/hal/cmsis_6/CMSIS/Core/Include -IC:/ncs/v3.2.0-rc2/zephyr/modules/cmsis_6/. -IC:/n
    cs/v3.2.0-rc2/nrf/modules/hal_nordic/. -IC:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx -IC:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/bsp/stable -I
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/bsp/stable/templates -IC:/ncs/v3.2.0-rc2/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v3.2.0-rc2/modules/debug/segger/SEGGER -IC:/ncs/v3.2.0-rc2/modules/debug/se
    gger/Config -IC:/ncs/v3.2.0-rc2/modules/lib/zcbor/include -IC:/ncs/v3.2.0-rc2/nrfxlib/softdevice_controller/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/common/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl
    /fem/nrf21540_gpio/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/nrf21540_gpio_spi/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/nrf2220/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/nrf2240/include -IC:
    /ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/nrf22xx/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/simple_gpio/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/fem/include/prot
    ocol -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/include -IC:/ncs/v3.2.0-rc2/nrfxlib/mpsl/include/protocol -IC:/Users/SV/Documents/smartcup/build/smartcup/generated/interface_nrf_security_psa -IC:/ncs/
    v3.2.0-rc2/nrf/subsys/nrf_security/include -IC:/ncs/v3.2.0-rc2/modules/crypto/oberon-psa-crypto/include -IC:/ncs/v3.2.0-rc2/nrf/subsys/nrf_security/src/threading/include -IC:/ncs/v3.2.0-rc2/nrf/subsys
    /nrf_security/src/utils -IC:/ncs/v3.2.0-rc2/modules/crypto/oberon-psa-crypto/library -IC:/ncs/v3.2.0-rc2/modules/crypto/mbedtls/library -IC:/ncs/v3.2.0-rc2/modules/crypto/mbedtls/include -IC:/ncs/v3.2
    .0-rc2/modules/crypto/mbedtls/include/library -IC:/ncs/v3.2.0-rc2/nrfxlib/crypto/nrf_oberon/include -IC:/ncs/v3.2.0-rc2/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem C:/ncs/v3.2.0-rc2/zephyr/lib/
    libc/common/include -fno-strict-aliasing -Os -imacros C:/Users/SV/Documents/smartcup/build/smartcup/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=al
    ways -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/66cdf9b75e/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v3.2.0-rc2/zephyr/include/z
    ephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werro
    r=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/Users/SV/Documents/
    smartcup=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v3.2.0-rc2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v3.2.0-rc2=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -M
    D -MT modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c.obj -MF modules\hal_nordic\modules\hal_nord
    ic\nrfx\CMakeFiles\modules__hal_nordic__nrfx.dir\C_\ncs\v3.2.0-rc2\modules\hal\nordic\nrfx\drivers\src\nrfx_rramc.c.obj.d -o modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__
    nrfx.dir/C_/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c.obj -c C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c
    In file included from C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:35:
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include/nrfx_rramc.h: In function 'nrfx_rramc_otp_word_write':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include/nrfx_rramc.h:308:38: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      308 |     return nrfy_rramc_otp_word_write(NRF_RRAMC, index, value);
          |                                      ^~~~~~~~~
          |                                      NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include/nrfx_rramc.h:308:38: note: each undeclared identifier is reported only once for each function it appears in
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include/nrfx_rramc.h: In function 'nrfx_rramc_ready_check':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/include/nrfx_rramc.h:328:35: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      328 |     return nrfy_rramc_ready_check(NRF_RRAMC);
          |                                   ^~~~~~~~~
          |                                   NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_all_erase':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:106:30: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      106 |     nrfy_rramc_erase_all_set(NRF_RRAMC);
          |                              ^~~~~~~~~
          |                              NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_byte_write':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:117:27: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      117 |     nrfy_rramc_byte_write(NRF_RRAMC, address, value);
          |                           ^~~~~~~~~
          |                           NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_bytes_write':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:127:28: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      127 |     nrfy_rramc_bytes_write(NRF_RRAMC, address, src, num_bytes);
          |                            ^~~~~~~~~
          |                            NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_word_write':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:137:27: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      137 |     nrfy_rramc_word_write(NRF_RRAMC, address, value);
          |                           ^~~~~~~~~
          |                           NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_words_write':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:149:28: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      149 |     nrfy_rramc_words_write(NRF_RRAMC, address, src, num_words);
          |                            ^~~~~~~~~
          |                            NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_write_enable_set':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:158:27: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      158 |     nrfy_rramc_config_set(NRF_RRAMC, &rramc_config);
          |                           ^~~~~~~~~
          |                           NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_write_enable_check':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:164:27: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      164 |     nrfy_rramc_config_get(NRF_RRAMC, &rramc_config);
          |                           ^~~~~~~~~
          |                           NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'rramc_configure':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:186:26: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      186 |     nrfy_rramc_configure(NRF_RRAMC, &nrfy_config);
          |                          ^~~~~~~~~
          |                          NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_uninit':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:248:27: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      248 |     nrfy_rramc_int_uninit(NRF_RRAMC);
          |                           ^~~~~~~~~
          |                           NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_write_buffer_commit':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:265:29: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      265 |     nrfy_rramc_task_trigger(NRF_RRAMC, NRF_RRAMC_TASK_COMMIT_WRITEBUF);
          |                             ^~~~~~~~~
          |                             NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_wake_up':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:270:29: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      270 |     nrfy_rramc_task_trigger(NRF_RRAMC, NRF_RRAMC_TASK_WAKEUP);
          |                             ^~~~~~~~~
          |                             NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_write_buffer_empty_check':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:275:42: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      275 |     return nrfy_rramc_empty_buffer_check(NRF_RRAMC);
          |                                          ^~~~~~~~~
          |                                          NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'RRAMC_IRQHandler':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:282:47: error: 'NRF_RRAMC' undeclared (first use in this function); did you mean 'NRF_RRAMC_S'?
      282 |     uint32_t evts = nrfy_rramc_events_process(NRF_RRAMC, NRF_RRAMC_ALL_INTS_MASK);
          |                                               ^~~~~~~~~
          |                                               NRF_RRAMC_S
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c: In function 'nrfx_rramc_write_buffer_empty_check':
    C:/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_rramc.c:276:1: warning: control reaches end of non-void function [-Wreturn-type]
      276 | }
          | ^
    [284/371] Building C object modules/hal_nordic/modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v3.2.0-rc2/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    ninja: build stopped: subcommand failed.
    [14/20] cmd.exe /C "cd /D C:\Users\SV\Documents\smartcup\build\_sysbuild && C:\ncs\toolchains\66cdf9b75e\opt\bin\cmake.exe -E true"
    FAILED: _sysbuild/sysbuild/images/smartcup-prefix/src/smartcup-stamp/smartcup-build C:/Users/SV/Documents/smartcup/build/_sysbuild/sysbuild/images/smartcup-prefix/src/smartcup-stamp/smartcup
    -build
    cmd.exe /C "cd /D C:\Users\SV\Documents\smartcup\build\smartcup && C:\ncs\toolchains\66cdf9b75e\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\66cdf9b75e\opt\bin\cmake.EXE' --build C:/Users/SV/Documents/smartcup/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

    I checked the build files that are made and inside i found:

    PS C:\Users\SV\Documents\smartcup> cat build\mcuboot\zephyr\.config | findstr "FPROTECT"
    CONFIG_FPROTECT_BLOCK_SIZE=0x1000
    CONFIG_FPROTECT=y
    # CONFIG_FPROTECT_APP is not set
    CONFIG_FPROTECT_ALLOW_COMBINED_REGIONS=y

    Which makes me think that fprotect is enabled even if i did not explicitlymake the setting.

    Also it seems that i have found a bug in 3.2.0-rc2 when i provision the key with  

    west ncs-provision upload -k private_key.pem 

    the key doesn't seem to get provisioned I needed to add the --keyname option

     west ncs-provision upload -k private_key.pem --keyname BL_PUBKEY

    This way of provisioning seems to work. Is this intended?

Related