Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Infuse reboot APIs

Infuse reboot API . More...

Data Structures

union  infuse_reboot_info
 Detailed information about the reboot location/cause RISCV platforms have 16 byte alignment requirements for arch_esf. More...
 
struct  infuse_reboot_state
 Reboot state information. More...
 

Macros

#define REBOOT_STATE_THREAD_NAME_MAX   8
 

Enumerations

enum  infuse_reboot_reason {
  INFUSE_REBOOT_ZEPHYR_BASE = K_ERR_CPU_EXCEPTION , INFUSE_REBOOT_ARCH_SPECIFIC = K_ERR_ARCH_START , INFUSE_REBOOT_INFUSE_START = 128 , INFUSE_REBOOT_HW_WATCHDOG = 128 ,
  INFUSE_REBOOT_EXTERNAL_TRIGGER = 129 , INFUSE_REBOOT_RPC = 130 , INFUSE_REBOOT_LTE_MODEM_FAULT = 131 , INFUSE_REBOOT_MCUMGR = 132 ,
  INFUSE_REBOOT_CFG_CHANGE = 133 , INFUSE_REBOOT_SW_WATCHDOG = 134 , INFUSE_REBOOT_DFU = 135 , INFUSE_REBOOT_UNKNOWN = 255
}
 Enumeration of reboot reasons. More...
 
enum  infuse_reboot_info_type { INFUSE_REBOOT_INFO_GENERIC = 0 , INFUSE_REBOOT_INFO_EXCEPTION_BASIC , INFUSE_REBOOT_INFO_EXCEPTION_ESF , INFUSE_REBOOT_INFO_WATCHDOG }
 Type of infuse_reboot_info data. More...
 

Functions

_NORETURN void infuse_reboot (enum infuse_reboot_reason reason, uint32_t info1, uint32_t info2)
 Trigger a system 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.
 
int infuse_reboot_state_query (struct infuse_reboot_state *state)
 Query the reason for the previous reboot.
 

Detailed Description

Infuse reboot API .

Macro Definition Documentation

◆ REBOOT_STATE_THREAD_NAME_MAX

#define REBOOT_STATE_THREAD_NAME_MAX   8

#include <infuse/reboot.h>

Enumeration Type Documentation

◆ infuse_reboot_info_type

#include <infuse/reboot.h>

Type of infuse_reboot_info data.

Enumerator
INFUSE_REBOOT_INFO_GENERIC 
INFUSE_REBOOT_INFO_EXCEPTION_BASIC 

Exception with only PC and LR info.

INFUSE_REBOOT_INFO_EXCEPTION_ESF 

Exception with full stack frame.

INFUSE_REBOOT_INFO_WATCHDOG 

Hardware watchdog expiry.

◆ infuse_reboot_reason

#include <infuse/reboot.h>

Enumeration of reboot reasons.

Enumerator
INFUSE_REBOOT_ZEPHYR_BASE 

Common Zephyr exception codes.

INFUSE_REBOOT_ARCH_SPECIFIC 

Architecture specific exception codes.

INFUSE_REBOOT_INFUSE_START 

Infuse reboot reasons.

INFUSE_REBOOT_HW_WATCHDOG 

Hardware watchdog has expired.

INFUSE_REBOOT_EXTERNAL_TRIGGER 

Triggered externally (Button, etc)

INFUSE_REBOOT_RPC 

Remote procedure call.

INFUSE_REBOOT_LTE_MODEM_FAULT 

Internal LTE modem fault.

INFUSE_REBOOT_MCUMGR 

MCUmgr request.

INFUSE_REBOOT_CFG_CHANGE 

Rebooting due to configuration change.

INFUSE_REBOOT_SW_WATCHDOG 

Software watchdog has expired.

INFUSE_REBOOT_DFU 

Rebooting for device firmware update.

INFUSE_REBOOT_UNKNOWN 

Unknown reboot reason.

Function Documentation

◆ infuse_reboot()

_NORETURN void infuse_reboot ( enum infuse_reboot_reason reason,
uint32_t info1,
uint32_t info2 )

#include <infuse/reboot.h>

Trigger a system reboot.

Parameters
reasonReason the system is rebooting
info1Generic information to identify/diagnose the reboot
info2Generic information to identify/diagnose the reboot

◆ infuse_reboot_delayed()

void infuse_reboot_delayed ( enum infuse_reboot_reason reason,
uint32_t info1,
uint32_t info2,
k_timeout_t delay )

#include <infuse/reboot.h>

Trigger a system reboot in the future.

Parameters
reasonReason the system is rebooting
info1Generic information to identify/diagnose the reboot
info2Generic information to identify/diagnose the reboot
delayTime delay or absolute time to execute the reboot

◆ infuse_reboot_state_query()

int infuse_reboot_state_query ( struct infuse_reboot_state * state)

#include <infuse/reboot.h>

Query the reason for the previous reboot.

If this function returns 0, state->hardware_reason contains the reboot reason and the hardware register values are cleared.

Warning
Will only return valid state on the first call.
Parameters
stateState storage area
Return values
0On successful state query
-ENOENTNo stored state exists
-errnoOther error from retention_read