Thingy91:x nRF5340 does not boot with external flash

Hello,

I am trying to build a firmware for the nRF5340 on the Thingy91:x. The firmware should use the external flash for the secondary Image and is using the chained bootload setup with NSIB -> MCUboot -> App-Firmware.

Unfortunately my bootloader encounters a BUS FAULT:

D: stack 0x2005c1b0 for thread 0x200027e0: obj_size=20240 buf_start=0x2005c1b0  buf_size 20240 stack_ptr=0x200610c0
D: stack 0x2005c070 for thread 0x20002760: obj_size=320 buf_start=0x2005c070  buf_size 320 stack_ptr=0x2005c1b0
D: Event: LFCLK_STARTED
D: lfclk: Clock started
I: Function: nrfx_spim_init, error code: NRFX_SUCCESS.
D: tx_bufs 0x20060fc8 - rx_bufs 0 - 1
D: current_tx 0x20060fd8 (1), current_rx 0 (0), tx buf/len 0x20060fc0/1, rx buf/len 0/0
I: Function: spim_xfer, error code: NRFX_SUCCESS.
E: Timeout waiting for transfer complete
E: Failed to stop instance with base address: 0x5000c000.
I: Uninitialized.
D: Transaction finished with status -116
E: Failed to exit DPD (-116)
*** Booting My Application v2.1.0-dev-ae1ee57f3906 ***
*** Using nRF Connect SDK v3.0.0-3bfc46578e42 ***
*** Using Zephyr OS v4.0.99-a0e545cb437a ***
D: scheduler unlocked (0x200027e0:0)
I: Starting bootloader
�W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=2048 - too small?
E: ***** BUS FAULT *****
E:   Precise data bus error
E:   BFAR Address: 0x10fd08
E: r0/a1:  0x0010fd00  r1/a2:  0x00111120  r2/a3:  0x2001ad30
E: r3/a4:  0x00000020 r12/ip:  0x0000ba01 r14/lr:  0x00009a3d
E:  xpsr:  0x89000000
E: Faulting instruction address (r15/pc): 0x00011544
E: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
E: Current thread: 0x200027e0 (unknown)
E: Halting system

A minimal example is attached (build for thingy91x/nrf5340/cpuapp).
Increasing the CONFIG_BOOT_MAX_IMG_SECTORS=2048 even further did not change anything.

Can you tell me how to debug further?

Best Regards
Johannes

1663.app.zip

Related