Slot management tools.
More...
#include <stddef.h>
#include "riotboot/hdr.h"
Go to the source code of this file.
◆ riotboot_slot_activate_other()
| void riotboot_slot_activate_other |
( |
bool |
active | ) |
|
Activate or deactivate the other slot.
This function sets the image state to ACTIVATED or DEACTIVATED in the header of the non-running image slot.
A deactivated slot can be activated but an activated slot cannot be deactivated.
- Parameters
-
| [in] | active | if true, set to ACTIVATED, else set to INACTIVE |
◆ riotboot_slot_confirm()
| void riotboot_slot_confirm |
( |
void |
| ) |
|
Confirm the currently running image slot.
This function sets the image state to CONFIRMED in the header of the currently running image, if it is in ACTIVATED state. It must be called manually if not module riotboot_hdr_auto_confirm is used.
◆ riotboot_slot_current()
| int riotboot_slot_current |
( |
void |
| ) |
|
Get currently running image slot.
- Returns
- nr of currently active slot
◆ riotboot_slot_get_current_hdr()
Get header from currently running image slot.
- Returns
- header of current image
Definition at line 79 of file slot.h.
◆ riotboot_slot_get_hdr()
Get header from a given flash slot.
- Parameters
-
| [in] | slot | slot nr to work on |
- Returns
- header of image slot nr
slot
◆ riotboot_slot_get_image_startaddr()
| uint32_t riotboot_slot_get_image_startaddr |
( |
unsigned |
slot | ) |
|
Get jump-to address of image slot.
- Parameters
-
| [in] | slot | slot nr to work on |
- Returns
- address of first byte of
slot
◆ riotboot_slot_jump()
| void riotboot_slot_jump |
( |
unsigned |
slot | ) |
|
Boot into image in slot slot.
- Parameters
-
| [in] | slot | slot nr to jump to |
◆ riotboot_slot_other()
| int riotboot_slot_other |
( |
void |
| ) |
|
Get currently not running image slot.
- Returns
- nr of currently inactive slot
◆ riotboot_slot_print_hdr()
| static void riotboot_slot_print_hdr |
( |
unsigned |
slot | ) |
|
|
inlinestatic |
Print formatted slot header to STDIO.
- Parameters
-
| [in] | slot | slot nr to work on |
Definition at line 106 of file slot.h.
◆ riotboot_slot_size()
| static size_t riotboot_slot_size |
( |
unsigned |
slot | ) |
|
|
inlinestatic |
Get the size of a slot.
- Parameters
-
| [in] | slot | slot nr to get the size from |
- Returns
- The slot size in bytes
Definition at line 150 of file slot.h.
◆ riotboot_slot_validate()
| static int riotboot_slot_validate |
( |
unsigned |
slot | ) |
|
|
inlinestatic |
Validate slot.
- Parameters
-
| [in] | slot | slot nr to work on |
- Returns
- 0 if ok.
Definition at line 95 of file slot.h.
◆ riotboot_slot_numof
| const unsigned riotboot_slot_numof |
|
extern |
Number of configured firmware slots (incl.
bootloader slot)