1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdint.h>
8 #include <zephyr/sys/reboot.h>
9 #include <zephyr/retention/bootmode.h>
10 #include <zephyr/kernel.h>
11 #include <stdio.h>
12 
main(void)13 int main(void)
14 {
15 	printf("Waiting...\n");
16 	k_sleep(K_SECONDS(1));
17 
18 	int rc = bootmode_set(BOOT_MODE_TYPE_BOOTLOADER);
19 
20 	if (rc == 0) {
21 		sys_reboot(SYS_REBOOT_WARM);
22 	} else {
23 		printf("Error, failed to set boot mode: %d\n", rc);
24 	}
25 
26 	return 0;
27 }
28