Skip to content

Commit 5f52f93

Browse files
nvlsianpurlubos
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]> (cherry picked from commit 29fdb63)
1 parent 1953d93 commit 5f52f93

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
@@ -2636,6 +2640,12 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
26362640
rc = boot_perform_update(state, &bs);
26372641
}
26382642
assert(rc == 0);
2643+
#if defined(PM_S1_ADDRESS) && defined(CONFIG_REBOOT)
2644+
if (owner_nsib[BOOT_CURR_IMG(state)]) {
2645+
sys_reboot(SYS_REBOOT_COLD);
2646+
2647+
}
2648+
#endif
26392649
break;
26402650

26412651
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)