Skip to content

Commit 8541955

Browse files
nvlsianpuanangl
authored andcommitted
[nrf noup] boot/../loader: reboot after updating s0/s1
As this is MCUboot updating itself, it should reboot the device so NSIB will chainload the update MCUboot Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 776ee26 commit 8541955

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

boot/bootutil/src/loader.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
#include "bootutil/boot_hooks.h"
5050
#include "bootutil/mcuboot_status.h"
5151

52+
#ifdef __ZEPHYR__
53+
#include <zephyr/sys/reboot.h>
54+
#endif
55+
5256
#if defined(CONFIG_SOC_NRF5340_CPUAPP) && defined(PM_CPUNET_B0N_ADDRESS)
5357
#include <dfu/pcd.h>
5458
#ifdef CONFIG_PCD_READ_NETCORE_APP_VERSION
@@ -2506,6 +2510,12 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
25062510
rc = boot_perform_update(state, &bs);
25072511
}
25082512
assert(rc == 0);
2513+
#if defined(PM_S1_ADDRESS) && defined(CONFIG_REBOOT)
2514+
if (owner_nsib[BOOT_CURR_IMG(state)]) {
2515+
sys_reboot(SYS_REBOOT_COLD);
2516+
2517+
}
2518+
#endif
25092519
break;
25102520

25112521
case BOOT_SWAP_TYPE_FAIL:

boot/zephyr/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config MCUBOOT
1818
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
1919
select USE_DT_CODE_PARTITION if HAS_FLASH_LOAD_OFFSET
2020
select MCUBOOT_BOOTUTIL_LIB
21+
select REBOOT if SECURE_BOOT
2122

2223
config BOOT_USE_MBEDTLS
2324
bool

0 commit comments

Comments
 (0)