I have finally got FOTA working with external flash, but I have a strange problem.
When the FOTA is complete, the mcuboot fails, but the new image boots correctly.
So it seems to work, but I would like to know the root cause for this problem.
Below is a dump from my terminal.
[00:00:01.307,373] <inf> mcuboot: Image 0 copying the secondary slot to the primary slot: 0x3133c bytes
[00:00:05.330,017] <dbg> mcuboot: boot_write_magic: writing magic; fa_id=3 off=0x6dff0 (0x7dff0)
[00:00:05.330,322] <dbg> mcuboot: boot_copy_image: erasing secondary header
[00:00:05.373,046] <dbg> mcuboot: boot_copy_image: erasing secondary trailer
[00:00:05.376,342] <err> os: ***** BUS FAULT *****
[00:00:05.376,373] <err> os: Precise data bus error
[00:00:05.376,373] <err> os: BFAR Address: 0xfffffffa
[00:00:05.376,373] <err> os: r0/a1: 0xffffffea r1/a2: 0x0006d000 r2/a3: 0x00001000
[00:00:05.376,403] <err> os: r3/a4: 0x0000bc30 r12/ip: 0x00000000 r14/lr: 0x00000ca5
[00:00:05.376,403] <err> os: xpsr: 0xa1000000
[00:00:05.376,403] <err> os: Faulting instruction address (r15/pc): 0x00009940
[00:00:05.376,434] <err> os: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
[00:00:05.376,464] <err> os: Current thread: 0x20000758 (unknown)
�boot_go6.004,730] <err> fatal_error: Resetting system
New firmware loads correctly here...
The faulting instruction address: 0x00009940 is:
C:/ncs/v2.6.1/zephyr/drivers/clock_control/clock_control_nrf.c:124
Which is the line: return GET_STATUS(get_sub_data(dev, type)->flags);