blob: 9b0391985f96f0d3030392b5df647239a34387aa [file] [log] [blame]
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <zephyr/sys/reboot.h>
#include <zephyr/retention/bootmode.h>
#include <zephyr/kernel.h>
#include <stdio.h>
int main(void)
{
printf("Waiting...\n");
k_sleep(K_SECONDS(1));
int rc = bootmode_set(BOOT_MODE_TYPE_BOOTLOADER);
if (rc == 0) {
sys_reboot(SYS_REBOOT_WARM);
} else {
printf("Error, failed to set boot mode: %d\n", rc);
}
return 0;
}