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
62
74
81 /* Generic reboot information */
82 struct {
84 uint32_t info1;
86 uint32_t info2;
87 } __packed generic;
88 /* Basic exception information */
89 struct {
93 uint32_t link_register;
94 } __packed exception_basic;
95 /* Exception stack frame */
96 struct arch_esf exception_full;
97 /* Watchdog reboot information */
98 struct {
100 uint32_t info1;
102 uint32_t info2;
103 } __packed watchdog;
104} __packed __aligned(16);
105
131
133#define _NORETURN COND_CODE_1(CONFIG_INFUSE_REBOOT_RETURN, (), (FUNC_NORETURN))
135
143_NORETURN void infuse_reboot(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2);
144
153void infuse_reboot_delayed(enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2,
154 k_timeout_t delay);
155
171
175
176#ifdef __cplusplus
177}
178#endif
179
180#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:64
_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_CFG_CHANGE
Rebooting due to configuration change.
Definition reboot.h:52
@ INFUSE_REBOOT_UNKNOWN
Unknown reboot reason.
Definition reboot.h:60
@ 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:66
@ INFUSE_REBOOT_INFO_EXCEPTION_BASIC
Exception with only PC and LR info.
Definition reboot.h:68
@ INFUSE_REBOOT_INFO_EXCEPTION_ESF
Exception with full stack frame.
Definition reboot.h:70
@ INFUSE_REBOOT_INFO_WATCHDOG
Hardware watchdog expiry.
Definition reboot.h:72
Reboot state information.
Definition reboot.h:107
uint32_t hardware_reason
Hardware reboot reason flags.
Definition reboot.h:121
union infuse_reboot_info info
Reboot information.
Definition reboot.h:129
char thread_name[8]
Thread executing at reboot time.
Definition reboot.h:123
enum infuse_reboot_info_type info_type
Type of the information in info.
Definition reboot.h:125
uint64_t epoch_time
The epoch time at the reboot.
Definition reboot.h:115
uint8_t epoch_time_source
First 3 parameters are updated a second time on delayed reboots.
Definition reboot.h:113
enum infuse_reboot_reason reason
Reason for the reboot.
Definition reboot.h:119
uint32_t uptime
The device uptime at the reboot.
Definition reboot.h:117
Detailed information about the reboot location/cause RISCV platforms have 16 byte alignment requireme...
Definition reboot.h:80
struct arch_esf exception_full
Definition reboot.h:96
struct infuse_reboot_info::@253111261131321333207107151242253117143311116322 exception_basic
uint32_t info1
Info 1.
Definition reboot.h:84
struct infuse_reboot_info::@120023347310254224134131011170320041272273377226 watchdog
uint32_t link_register
Link register value at exception.
Definition reboot.h:93
uint32_t program_counter
Program counter value at exception.
Definition reboot.h:91
uint32_t info2
Info 2.
Definition reboot.h:86