diff --git a/soc/arm/nordic_nrf/nrf52/soc.c b/soc/arm/nordic_nrf/nrf52/soc.c index e1e63e9f874e..eb29ddd0b506 100644 --- a/soc/arm/nordic_nrf/nrf52/soc.c +++ b/soc/arm/nordic_nrf/nrf52/soc.c @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef CONFIG_RUNTIME_NMI extern void z_arm_nmi_init(void); @@ -51,8 +52,13 @@ LOG_MODULE_REGISTER(soc); Set general purpose retention register and reboot */ void sys_arch_reboot(int type) { - nrf_power_gpregret_set(NRF_POWER, (uint8_t)type); - NVIC_SystemReset(); + if (type == 0xFE){ + nrf_power_system_off(NRF_POWER); + } + else{ + nrf_power_gpregret_set(NRF_POWER, (uint8_t)type); + NVIC_SystemReset(); + } } static int nordicsemi_nrf52_init(const struct device *arg)