K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
boot.h File Reference
#include <stdint.h>
#include <kfsw/services/parameter.h>

Macros

#define KFSW_BOOT_PARAM_TABLE_ID   32U
 
#define KFSW_BOOT_PARAM_TABLE_NAME   "boot"
 

Enumerations

enum  kfsw_event_boot_id { KFSW_EVENT_BOOT_READY = 1 , KFSW_EVENT_BOOT_LASTWORDS = 2 }
 

Functions

void kfsw_boot_service_start (void)
 
uint32_t kfsw_boot_get_reset_cause (void)
 
int kfsw_boot_get_reset_result (void)
 
const char * kfsw_boot_get_image_version (void)
 
const char * kfsw_boot_get_revisions (void)
 
const char * kfsw_boot_get_hardware_id (void)
 
void kfsw_boot_count_restart (void)
 
uint32_t kfsw_boot_get_count (void)
 

Variables

const struct kfsw_param_definition_set kfsw_boot_param_definitions
 

Description

Boot and readiness marker API.

Macro Documentation

◆ KFSW_BOOT_PARAM_TABLE_ID

#define KFSW_BOOT_PARAM_TABLE_ID   32U

Parameter table of this service, in the service band.

◆ KFSW_BOOT_PARAM_TABLE_NAME

#define KFSW_BOOT_PARAM_TABLE_NAME   "boot"

Parameter table name.

Enumeration Documentation

◆ kfsw_event_boot_id

Event IDs of the boot service.

IDs are never reused.

Enumerator
KFSW_EVENT_BOOT_READY 

Startup finished.

Payload: reset cause big-endian u32, then a byte that is non-zero when the cause could not be read.

KFSW_EVENT_BOOT_LASTWORDS 

The previous run left a note.

Payload: reason byte, then detail, uptime in milliseconds and boot count, each a big-endian u32.

Function Documentation

◆ kfsw_boot_count_restart()

void kfsw_boot_count_restart ( void  )

Count a restart.

Called after the snapshot is restored, so the count continues from the saved value. The count saturates.

◆ kfsw_boot_get_count()

uint32_t kfsw_boot_get_count ( void  )

Restarts recorded across the life of the node.

◆ kfsw_boot_get_hardware_id()

const char * kfsw_boot_get_hardware_id ( void  )

The chip's unique ID, read at boot.

Never NULL; empty when the SoC has none.

◆ kfsw_boot_get_image_version()

const char * kfsw_boot_get_image_version ( void  )

Version of the running image, from the build.

◆ kfsw_boot_get_reset_cause()

uint32_t kfsw_boot_get_reset_cause ( void  )

Reset cause latched at boot.

Zero before the service has run.

◆ kfsw_boot_get_reset_result()

int kfsw_boot_get_reset_result ( void  )

Result of the latched read: 0 if the cause is trustworthy.

◆ kfsw_boot_get_revisions()

const char * kfsw_boot_get_revisions ( void  )

Short revision of every repository compiled into this image.

Formatted as app:<sha> plat:<sha> svc:<sha> comms:<sha> mod:<sha>, with a trailing + on a repository that had uncommitted changes when it was built. The image version identifies only k-fsw; this string also identifies its dependencies.

◆ kfsw_boot_service_start()

void kfsw_boot_service_start ( void  )

Emit the boot and readiness markers.

Variable Documentation

◆ kfsw_boot_param_definitions

const struct kfsw_param_definition_set kfsw_boot_param_definitions
extern

Image identity and last reset reason.