|
K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
|
Enumerations | |
| enum | kfsw_golden_outcome { KFSW_GOLDEN_NOT_NEEDED = 0 , KFSW_GOLDEN_INSTALLED } |
Functions | |
| bool | kfsw_golden_present (void) |
| int | kfsw_golden_install (void) |
| int | kfsw_golden_check (enum kfsw_golden_outcome *outcome) |
Installs the image held in the golden partition when the early flash boot budget reaches zero.
The bootloader only boots the slots, so installing means copying the image into the secondary slot and asking for a trial swap.
| enum kfsw_golden_outcome |
| int kfsw_golden_check | ( | enum kfsw_golden_outcome * | outcome | ) |
#include <golden.h>
Install Golden at zero budget; MCUboot revert takes priority (-EBUSY).
| outcome | Filled with the decision. Must not be NULL. |
| 0 | on success, a negative errno when the decision could not be made. |
| int kfsw_golden_install | ( | void | ) |
#include <golden.h>
Copy the recovery image into the secondary slot and schedule a swap.
The caller restarts the node. Refused with -EBUSY while the bootloader still needs the secondary slot to revert, because that revert is the cheaper recovery and it comes first. If cleanup fails, a later explicit install retries only the exact acquired transfer before beginning another copy.
| 0 | on success. |
| -ENOENT | when the partition holds no image. |
| -EBADMSG | when the image does not match its own SHA-256 TLV; the secondary slot is left untouched. |
| -ENODEV | when this build has no golden partition. |
| bool kfsw_golden_present | ( | void | ) |
#include <golden.h>
Whether the golden partition holds something that looks like an image.
Checks the bootloader's magic only. kfsw_golden_install() also checks the image against its SHA-256 TLV before it erases anything; the signature is checked by the bootloader when it swaps.