Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
reboot.h
Go to the documentation of this file.
1
11
12#ifndef INFUSE_SDK_INCLUDE_INFUSE_REBOOT_H_
13#define INFUSE_SDK_INCLUDE_INFUSE_REBOOT_H_
14
15#include <stdint.h>
16
17#include <zephyr/kernel.h>
18#include <zephyr/fatal_types.h>
19#include <zephyr/toolchain.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
30
31#define REBOOT_STATE_THREAD_NAME_MAX 8
32
64
76
83 /* Generic reboot information */
84 struct {
86 uint32_t info1;
88 uint32_t info2;
89 } __packed generic;
90 /* Basic exception information */
91 struct {
95 uint32_t link_register;
96 } __packed exception_basic;
97 /* Exception stack frame */
98 struct arch_esf exception_full;
99 /* Watchdog reboot information */
100 struct {
102 uint32_t info1;
104 uint32_t info2;
105 } __packed watchdog;
106} __packed __aligned(16);
107
133
135#define _NORETURN COND_CODE_1(CONFIG_INFUSE_REBOOT_RETURN, (), (FUNC_NORETURN))
137
145_NORETURN void infuse_reboot(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2);
146
159void infuse_reboot_delayed(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2,
160 k_timeout_t delay);
161
177
181
182#ifdef __cplusplus
183}
184#endif
185
186#endif /* INFUSE_SDK_INCLUDE_INFUSE_REBOOT_H_ */
int infuse_reboot_state_query(struct infuse_reboot_state *state)
Query the reason for the previous reboot.
void infuse_reboot_delayed(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2, k_timeout_t delay)
Trigger a system reboot in the future.
infuse_reboot_reason
Enumeration of reboot reasons.
Definition reboot.h:34
#define REBOOT_STATE_THREAD_NAME_MAX
Definition reboot.h:31
infuse_reboot_info_type
Type of infuse_reboot_info data.
Definition reboot.h:66
_NORETURN void infuse_reboot(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2)
Trigger a system reboot.
@ INFUSE_REBOOT_MCUMGR
MCUmgr request.
Definition reboot.h:50
@ INFUSE_REBOOT_SW_WATCHDOG
Software watchdog has expired.
Definition reboot.h:54
@ INFUSE_REBOOT_INFUSE_START
Infuse reboot reasons.
Definition reboot.h:40
@ INFUSE_REBOOT_EXTERNAL_TRIGGER
Triggered externally (Button, etc)
Definition reboot.h:44
@ INFUSE_REBOOT_HW_WATCHDOG
Hardware watchdog has expired.
Definition reboot.h:42
@ INFUSE_REBOOT_RPC
Remote procedure call.
Definition reboot.h:46
@ INFUSE_REBOOT_MPSL_FAULT
Nordic MPSL fault.
Definition reboot.h:60
@ INFUSE_REBOOT_CFG_CHANGE
Rebooting due to configuration change.
Definition reboot.h:52
@ INFUSE_REBOOT_UNKNOWN
Unknown reboot reason.
Definition reboot.h:62
@ INFUSE_REBOOT_LTE_MODEM_FAULT
Internal LTE modem fault.
Definition reboot.h:48
@ INFUSE_REBOOT_DFU
Rebooting for device firmware update.
Definition reboot.h:56
@ INFUSE_REBOOT_ZEPHYR_BASE
Common Zephyr exception codes.
Definition reboot.h:36
@ INFUSE_REBOOT_ARCH_SPECIFIC
Architecture specific exception codes.
Definition reboot.h:38
@ INFUSE_REBOOT_BT_CTLR_FAULT
Bluetooth controller fault.
Definition reboot.h:58
@ INFUSE_REBOOT_INFO_GENERIC
Definition reboot.h:68
@ INFUSE_REBOOT_INFO_EXCEPTION_BASIC
Exception with only PC and LR info.
Definition reboot.h:70
@ INFUSE_REBOOT_INFO_EXCEPTION_ESF
Exception with full stack frame.
Definition reboot.h:72
@ INFUSE_REBOOT_INFO_WATCHDOG
Hardware watchdog expiry.
Definition reboot.h:74
Reboot state information.
Definition reboot.h:109
uint32_t hardware_reason
Hardware reboot reason flags.
Definition reboot.h:123
union infuse_reboot_info info
Reboot information.
Definition reboot.h:131
char thread_name[8]
Thread executing at reboot time.
Definition reboot.h:125
enum infuse_reboot_info_type info_type
Type of the information in info.
Definition reboot.h:127
uint64_t epoch_time
The epoch time at the reboot.
Definition reboot.h:117
uint8_t epoch_time_source
First 3 parameters are updated a second time on delayed reboots.
Definition reboot.h:115
enum infuse_reboot_reason reason
Reason for the reboot.
Definition reboot.h:121
uint32_t uptime
The device uptime at the reboot.
Definition reboot.h:119
Detailed information about the reboot location/cause RISCV platforms have 16 byte alignment requireme...
Definition reboot.h:82
struct arch_esf exception_full
Definition reboot.h:98
struct infuse_reboot_info::@253111261131321333207107151242253117143311116322 exception_basic
uint32_t info1
Info 1.
Definition reboot.h:86
struct infuse_reboot_info::@120023347310254224134131011170320041272273377226 watchdog
uint32_t link_register
Link register value at exception.
Definition reboot.h:95
uint32_t program_counter
Program counter value at exception.
Definition reboot.h:93
uint32_t info2
Info 2.
Definition reboot.h:88