Memory Access Error when erasing/writing external flash and HW WDG enabled.

We are currently working with a system that is using both and external flash and the HW WDG from the NRF5340.

Recently we are facing the issue, that we cannot re-flash the device cleanly, because we get following error:

west flash
...
Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)


After re-trying the `west flash`, we end up with locked AP, so we need to `--recover` the device first, before being able to flash it again.

Debug access to the Network core is currently disabled. The Network core is either protected or not started, and it is not possible to start the Network core through the Application core: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)


The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible to unlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.


We tracked down the issue up to the point where we suspect following chain of events.

1. The normal firmware is running. It has armed the HW WDG (`CONFIG_TASK_WDT_HW_FALLBACK=y`). The HW WGD timeout is 7.7s

2. Now we want to flash the new SW with `west flash`
  2.1 First the CPU gets halted --> This also halts the HW WDG

  2.2 Now the internal flash gets erased
  2.3 Now the external flash gets erased. This requires the QSPI loader to run --> CPU is running --> WDG is running
  2.4 Now the external flash gets flashed. -->WDG running
  2.5 Now the internal flash gets flashed
3. The HW watchdog expires at some point during step 2.4/2.5 (the erase/flash operation are taking longer than 7.7s)
4. The expired WDG causes a reset. The chip reboots at address 0x00 where no code is located after the erase --> No `SystemInit()` runs --> AP never opens up.
5. The debugger who tries to perform operations on the external flash fails due to the shown error.

 When trying to re-flash the device with `west flash` the debugger instantly noticed the closed debug port and throws the 2nd error.

Here's a filtered log from `nrfutil-device.log` which is backing our hypothesis of the explained sequence:

12:44:09.698 Programming build/merged.hex
12:44:09.942 -> halt
12:44:11.400 Performing system reset
12:44:11.400 -> halt
12:44:11.502 Erasing pages touched by firmware
12:44:27.786 Erasing pages from external memory
12:44:27.800 -> halt
12:44:27.912 Initial stack: 0x2000a840 Entry point: 0x20000ff4
12:44:28.038 -> halt
12:44:28.039 -> go
12:44:30.638 Done with device; restoring run state
12:44:30.638 -> halt ()
12:44:30.644 Programming 11 segments
12:44:30.663 Programming 10 segments to flash
12:44:30.663 NVMC: Programming 10 segments
12:44:34.494 Programming 2 segments to xip
12:44:34.511 -> halt
12:44:34.620 Initial stack: 0x2000a840 Entry point: 0x20000ff4
12:44:34.744 -> halt
12:44:34.746 -> go
12:44:38.926 Failed to write 3972 bytes at 0x20004ee0: Failed to write 3972 bytes to memory address
12:44:38.981 Probably a TrustZone access or other protection error. The original error is Failed to
12:44:38.981 Done with device; restoring run state
12:44:38.981 -> halt
12:44:39.028 Error executing operations for 506000982: Device error: Memory access error at 0x20004e

We verified this behavior with 
a) Flashing the device with `CONFIG_TASK_WDT_HW_FALLBACK=n`
b) Adding a well times pin-reset (pin-reset is apparently clearing the WDG. Soft/System/Hard-Reset are not clearing the WDG)
   The reset has to be performed within the small window where the debugger halts the SW before it has armed the WDG
c) By adding a small sample, that is: Opening the AP, (Stopping the WDG), keeping a buys loop so that it can be halted by the Debugger
c') We also noticed, that we do not need the active stop of the WDG if we flash our "keeper-sw" with option `reset=RESET_PIN`

Therefore we are quite positive about the fact that the HW WDG is causing the error during XIP operations.


Now there's the catch:
This behavior started, when we were migrating NCS to NCS version 3.4.0
The HW watchdog was in a few months earlier. Therefore we are questioning, whether were some changes to the nrfutil in either the flash sequence or reset behavior that, is causing the error to pop up now.

Unfortunately I cannot reproduce this error on a dev-kit, since those are not quipped with an external flash, but in case you have one at hand, just make a minimal sample with the HW WDG running and a bunch of stuff on the ext-flash so that you hit a very high chance of the HW WDG expiring during the external flash write/erase operation.

So for this ticket, my wish would be to resolve those two questions:
1) Is our hypothesis correct? Can the HW WDG interfere while the QSPI loader is within a flash/erase operation of the external flash?
2) Why is this issue coming up after the NCS 3.4.0 migration? Where there any changes to either the flash sequence, the `nrf_app_keeper.hex` or the reset behavior whilst `west flash`

With our proprietary keeper sample, flashing is working fine again, but imo this issue should be solved within the toolchain itself, by either:
- Actively clearing the HW WDG before flashing
- Flashing with PIN reset to clear the HW WDG
- Changing the flash sequence to first fully erase/flash the internal flash so that the AP gets opened up even if a reset occurs.

But before I request changes, I would first like to hear your take on this issue and whether this is valid or whether we are having a bad setup that is causing this :)

Some more details about our project:
SOC: nrf5340 + nrf7002 (application core with TF-M, network core with `hci_ipc`)
Board: Custom board with 8MB QSPI NOR flash for XIP
NCS version: Fork of NCS 3.4.0 (only few smaller patches applied)
nrfutil version: 8.1.1
nrfutil-device version: 8.1.1

Relevant configs:
CONFIG_BUILD_WITH_TFM=y
CONFIG_NRF_APPROTECT_USE_UICR=y
CONFIG_NRF_SECURE_APPROTECT_USE_UICR=y
CONFIG_TASK_WDT_HW_FALLBACK=y
CONFIG_TASK_WDT_MIN_TIMEOUT=7500
CONFIG_TASK_WDT_HW_FALLBACK_DELAY=200
CONFIG_XIP=y
CONFIG_NORDIC_QSPI_NOR_XIP=y


If there is any way you know, which can help us prevent these errors, we would be really glad to hear about it.
In case you have any extra questions, feel free to ask.
Thank you very much in advance!

Best regards

Jaro

Parents
  • Thanks for the hint.

    Here is a zip of a minimal sample which is reproducing the error on the DK:

    xip_wdg_fail.tar.gz



    Here are the logs of flashing the DK with the HW WDG variant and reproducing the error 3 consecutive times with recovering in between + logs of building the variant without HW WDG and successfully re-flashing the device several times:

    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/project/samples/xip_wdt_repro/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (5.7s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27944 B         1 MB      2.66%
                 RAM:        6312 B       448 KB      1.38%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20005ee0. Probably a memory protection issue. Probe access is Secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Timed out while waiting for MCU response (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/project/samples/xip_wdt_repro/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (6.1s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/180] Preparing syscall dependency handling
    
    [5/180] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [175/180] Linking C executable zephyr/zephyr_pre0.elf...mmand for additional byproducts on target: zephyr_pre0
    FAILED: [code=1] zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr_pre0.map
    : && ccache /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 -Os zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map,/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/posix/c_lib_ext/liblib__posix__c_lib_ext.a  zephyr/soc/soc/nrf5340/libsoc__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/hal_nordic/modules/hal_nordic/nrfx/libnrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr  zephyr/libcode_relocation_source_lib.a  zephyr/arch/common/libisr_tables.a  -fuse-ld=bfd  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -znoexecstack  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -Wl,--undefined=_sw_isr_table  -Wl,--undefined=_irq_vector_table  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF  /home/user/workdir/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.22.a -L"/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/thumb/v8-m.main/nofp/space" -lc -lgcc && cd /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr && /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/cmake -E true
    /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `main':
    /home/user/workdir/project/samples/xip_wdt_repro/src/main.c:35:(.text.main+0x4c): undefined reference to `__device_dts_ord_134'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/cmake --build /home/user/workdir/project/samples/xip_wdt_repro/build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/zephyr/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (6.3s)
    -- Generating done (0.2s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27944 B         1 MB      2.66%
                 RAM:        6312 B       448 KB      1.38%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.no_hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    
    warning: TASK_WDT_HW_FALLBACK_DELAY (defined at soc/st/stm32/stm32f0x/Kconfig.defconfig:14,
    soc/st/stm32/stm32f1x/Kconfig.defconfig:11, soc/st/stm32/stm32f4x/Kconfig.defconfig:19,
    soc/st/stm32/stm32l0x/Kconfig.defconfig:11, soc/st/stm32/stm32l1x/Kconfig.defconfig:9,
    /home/user/workdir/project/subsys/watchdog_manager/Kconfig:23, subsys/task_wdt/Kconfig:54) was
    assigned the value '200' but got the value ''. Check these unsatisfied dependencies:
    ((TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32F0X && SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK &&
    SOC_SERIES_STM32F1X && SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32F4X &&
    SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32L0X && SOC_FAMILY_STM32) ||
    (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32L1X && SOC_FAMILY_STM32) || BBM_WATCHDOG_MANAGER ||
    (TASK_WDT_HW_FALLBACK && TASK_WDT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TASK_WDT_HW_FALLBACK_DELAY and/or look up
    TASK_WDT_HW_FALLBACK_DELAY 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: TASK_WDT_MIN_TIMEOUT (defined at
    /home/user/workdir/project/subsys/watchdog_manager/Kconfig:17, subsys/task_wdt/Kconfig:40) was
    assigned the value '1000' but got the value ''. Check these unsatisfied dependencies:
    (BBM_WATCHDOG_MANAGER || (TASK_WDT_HW_FALLBACK && TASK_WDT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TASK_WDT_MIN_TIMEOUT and/or look up
    TASK_WDT_MIN_TIMEOUT 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 /home/user/workdir/zephyr/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (5.7s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27800 B         1 MB      2.65%
                 RAM:        6304 B       448 KB      1.37%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$
    

Reply
  • Thanks for the hint.

    Here is a zip of a minimal sample which is reproducing the error on the DK:

    xip_wdg_fail.tar.gz



    Here are the logs of flashing the DK with the HW WDG variant and reproducing the error 3 consecutive times with recovering in between + logs of building the variant without HW WDG and successfully re-flashing the device several times:

    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/project/samples/xip_wdt_repro/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (5.7s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27944 B         1 MB      2.66%
                 RAM:        6312 B       448 KB      1.38%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20005ee0. Probably a memory protection issue. Probe access is Secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Timed out while waiting for MCU response (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/project/samples/xip_wdt_repro/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (6.1s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/180] Preparing syscall dependency handling
    
    [5/180] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [175/180] Linking C executable zephyr/zephyr_pre0.elf...mmand for additional byproducts on target: zephyr_pre0
    FAILED: [code=1] zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr_pre0.map
    : && ccache /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 -Os zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map,/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/posix/c_lib_ext/liblib__posix__c_lib_ext.a  zephyr/soc/soc/nrf5340/libsoc__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/hal_nordic/modules/hal_nordic/nrfx/libnrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr  zephyr/libcode_relocation_source_lib.a  zephyr/arch/common/libisr_tables.a  -fuse-ld=bfd  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -znoexecstack  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -Wl,--undefined=_sw_isr_table  -Wl,--undefined=_irq_vector_table  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF  /home/user/workdir/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.22.a -L"/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/thumb/v8-m.main/nofp/space" -lc -lgcc && cd /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr && /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/cmake -E true
    /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/14.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `main':
    /home/user/workdir/project/samples/xip_wdt_repro/src/main.c:35:(.text.main+0x4c): undefined reference to `__device_dts_ord_134'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/cmake --build /home/user/workdir/project/samples/xip_wdt_repro/build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/user/workdir/zephyr/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (6.3s)
    -- Generating done (0.2s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27944 B         1 MB      2.66%
                 RAM:        6312 B       448 KB      1.38%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
     * 1050081332: Device error: Memory access error at 0x20004edc. Probably a memory protection issue. Probe access is Non-secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    Error: One or more batch tasks failed:
     * 1050081332: Failed to attach to target: The Application core access port is currently closed. AP-Protect might be enabled (NotAvailableBecauseProtection)
    
    
    The operation is unavailable for some of the devices because they have readback protection enabled. These devices might be possible tounlock using the `recover` subcommand. See `nrfutil device recover --help` for more information.
    
    ERROR: runners.nrfutil: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: your target is an nRF53; all flash memory for both the network and application cores will be erased prior to reflashing.
    FATAL ERROR: command exited with status 24: nrfutil --json device --x-ext-mem-config-file /home/user/workdir/zephyr/boards/nordic/nrf5340dk/support/nrf5340dk_qspi_nrfutil_config.json x-execute-batch --batch-path /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/generated_nrfutil_batch.json --serial-number 1050081332
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ rm -rf build
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west build -b nrf5340dk/nrf5340/cpuapp . -T sample.xip_wdt_repro.no_hw_wdt
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/user/workdir/project/samples/xip_wdt_repro
    -- CMake version: 4.2.1
    -- Found Python3: /home/user/ncs/toolchains/fbf7391cab/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter
    -- Cache files will be written to: /home/user/.cache/zephyr
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr)
    -- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
    -- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found toolchain: zephyr 1.0.1 (/home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk)
    -- Found Dtc: /home/user/ncs/toolchains/fbf7391cab/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.dts
    -- Generated pickled edt: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/devicetree_generated.h
    
    warning: TASK_WDT_HW_FALLBACK_DELAY (defined at soc/st/stm32/stm32f0x/Kconfig.defconfig:14,
    soc/st/stm32/stm32f1x/Kconfig.defconfig:11, soc/st/stm32/stm32f4x/Kconfig.defconfig:19,
    soc/st/stm32/stm32l0x/Kconfig.defconfig:11, soc/st/stm32/stm32l1x/Kconfig.defconfig:9,
    /home/user/workdir/project/subsys/watchdog_manager/Kconfig:23, subsys/task_wdt/Kconfig:54) was
    assigned the value '200' but got the value ''. Check these unsatisfied dependencies:
    ((TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32F0X && SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK &&
    SOC_SERIES_STM32F1X && SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32F4X &&
    SOC_FAMILY_STM32) || (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32L0X && SOC_FAMILY_STM32) ||
    (TASK_WDT_HW_FALLBACK && SOC_SERIES_STM32L1X && SOC_FAMILY_STM32) || BBM_WATCHDOG_MANAGER ||
    (TASK_WDT_HW_FALLBACK && TASK_WDT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TASK_WDT_HW_FALLBACK_DELAY and/or look up
    TASK_WDT_HW_FALLBACK_DELAY 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: TASK_WDT_MIN_TIMEOUT (defined at
    /home/user/workdir/project/subsys/watchdog_manager/Kconfig:17, subsys/task_wdt/Kconfig:40) was
    assigned the value '1000' but got the value ''. Check these unsatisfied dependencies:
    (BBM_WATCHDOG_MANAGER || (TASK_WDT_HW_FALLBACK && TASK_WDT)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TASK_WDT_MIN_TIMEOUT and/or look up
    TASK_WDT_MIN_TIMEOUT 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 /home/user/workdir/zephyr/Kconfig
    Loaded configuration '/home/user/workdir/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/prj.conf'
    Merged configuration '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/.config'
    Kconfig header saved to '/home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.43.1")
    -- The C compiler identification is GNU 14.3.0
    -- The CXX compiler identification is GNU 14.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/user/ncs/toolchains/fbf7391cab/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /home/user/ncs/toolchains/fbf7391cab/usr/bin/ccache
    -- Found gen_kobject_list: /home/user/workdir/zephyr/scripts/build/gen_kobject_list.py
    -- Configuring done (5.7s)
    -- Generating done (0.1s)
    -- Build files have been written to: /home/user/workdir/project/samples/xip_wdt_repro/build
    -- west build: building application
    [1/183] Preparing syscall dependency handling
    
    [5/183] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.4.0 (/home/user/workdir/zephyr), build: bbraun-ncs-v3.4.0-2-2-gb5258543dffe
    [183/183] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
            EXTFLASH:        768 KB         8 MB      9.38%
               FLASH:       27800 B         1 MB      2.65%
                 RAM:        6304 B       448 KB      1.37%
            IDT_LIST:           0 B        32 KB      0.00%
    Generating files from /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.elf for board: nrf5340dk/nrf5340/cpuapp
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash --recover
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Recovering and erasing flash memory for both the network and application cores.
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Recover
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$ west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    Using board 001050081332
    -- runners.nrfutil: Flashing file: /home/user/workdir/project/samples/xip_wdt_repro/build/zephyr/zephyr.hex
    -- runners.nrfutil: Connecting to probe
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board(s) with serial number(s) 1050081332 flashed successfully.
    user@0d898934197c:~/workdir/project/samples/xip_wdt_repro$
    

Children
  • Hi Jaro,

    Which NCS version did you migrate from? Was it v2.9.x or older?

    Starting from NCS v3.0.0, the default west flash runner changed from nrfjprog to nrfutil. So this could be an issue with nrfutil, that was not present in nrfjprog. I think that to program external flash, nrfutil might be running a loader on the application core and the CPU isn't halted while the loader runs, so WDT0 keeps counting, and it resets the chip mid-programming, while nrfjprog programs QSPI with the CPU halted, so the watchdog stays paused.

    Could you check whether

    west flash -r nrfjprog
    , fixes the problem for you?

Related