Skip to content

Commit

Permalink
[nrf noup] boot/../loader: reboot after updating s0/s1
Browse files Browse the repository at this point in the history
As this is MCUboot updating itself, it should reboot the device
so NSIB will chainload the update MCUboot

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
(cherry picked from commit 8541955)
  • Loading branch information
nvlsianpu authored and anangl committed Jun 28, 2024
1 parent d9fe011 commit daf2946
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
#include "bootutil/boot_hooks.h"
#include "bootutil/mcuboot_status.h"

#ifdef __ZEPHYR__
#include <zephyr/sys/reboot.h>
#endif

#if defined(CONFIG_SOC_NRF5340_CPUAPP) && defined(PM_CPUNET_B0N_ADDRESS)
#include <dfu/pcd.h>
#ifdef CONFIG_PCD_READ_NETCORE_APP_VERSION
Expand Down Expand Up @@ -2506,6 +2510,12 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
rc = boot_perform_update(state, &bs);
}
assert(rc == 0);
#if defined(PM_S1_ADDRESS) && defined(CONFIG_REBOOT)
if (owner_nsib[BOOT_CURR_IMG(state)]) {
sys_reboot(SYS_REBOOT_COLD);

}
#endif
break;

case BOOT_SWAP_TYPE_FAIL:
Expand Down
1 change: 1 addition & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config MCUBOOT
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
select USE_DT_CODE_PARTITION if HAS_FLASH_LOAD_OFFSET
select MCUBOOT_BOOTUTIL_LIB
select REBOOT if SECURE_BOOT

config BOOT_USE_MBEDTLS
bool
Expand Down

0 comments on commit daf2946

Please sign in to comment.