Slot management tools. More...

Detailed Description

Slot management tools.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e
Francisco Acosta franc.nosp@m.isco.nosp@m..acos.nosp@m.ta@i.nosp@m.nria..nosp@m.fr

Definition in file slot.h.

#include "riotboot/hdr.h"
+ Include dependency graph for slot.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int riotboot_slot_current (void)
 Get currently running image slot. More...
 
int riotboot_slot_other (void)
 Get currently not running image slot. More...
 
uint32_t riotboot_slot_get_image_startaddr (unsigned slot)
 Get jump-to address of image slot. More...
 
void riotboot_slot_jump (unsigned slot)
 Boot into image in slot slot. More...
 
const riotboot_hdr_triotboot_slot_get_hdr (unsigned slot)
 Get header from a given flash slot. More...
 
static int riotboot_slot_validate (unsigned slot)
 Validate slot. More...
 
static void riotboot_slot_print_hdr (unsigned slot)
 Print formatted slot header to STDIO. More...
 
size_t riotboot_slot_offset (unsigned slot)
 Get the offset (in flash, in bytes) for a given slot.
 
void riotboot_slot_dump_addrs (void)
 Dump the addresses of all configured slots. More...
 

Variables

const unsigned riotboot_slot_numof
 Number of configured firmware slots (incl. More...
 
const riotboot_hdr_t *const riotboot_slots []
 Storage for header pointers of the configured slots.
 

Function Documentation

◆ riotboot_slot_current()

int riotboot_slot_current ( void  )

Get currently running image slot.

Returns
nr of currently active slot

◆ riotboot_slot_dump_addrs()

void riotboot_slot_dump_addrs ( void  )

Dump the addresses of all configured slots.

◆ riotboot_slot_get_hdr()

const riotboot_hdr_t* riotboot_slot_get_hdr ( unsigned  slot)

Get header from a given flash slot.

Parameters
[in]slotslot 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]slotslot 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]slotslot 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]slotslot nr to work on

Definition at line 91 of file slot.h.

◆ riotboot_slot_validate()

static int riotboot_slot_validate ( unsigned  slot)
inlinestatic

Validate slot.

Parameters
[in]slotslot nr to work on
Returns
0 if ok.

Definition at line 80 of file slot.h.

Variable Documentation

◆ riotboot_slot_numof

const unsigned riotboot_slot_numof

Number of configured firmware slots (incl.

bootloader slot)