CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
boot_common.h
Go to the documentation of this file.
1
31#ifndef _SECOND_STAGE_BOOT_COMMON_H
32#define _SECOND_STAGE_BOOT_COMMON_H
33
34// Dependencies
35#include "core/cboot_error.h"
36#include "image/image.h"
37#include "second_stage/boot.h"
38
39// Initialization vector size of encrypted images in external flash memory
40#define INIT_VECT_SIZE 16
41
42// C++ guard
43#ifdef __cplusplus
44extern "C"
45{
46#endif
47
48// CycloneBOOT Bootloader common related functions
49void bootChangeState(BootContext *context, BootState newState);
51#if (EXTERNAL_MEMORY_SUPPORT == ENABLED)
53#endif
54cboot_error_t bootSelectUpdateImageSlot(BootContext *context, Slot *selectedSlot);
57
62cboot_error_t bootGetSlotImgHeader(Slot *slot, ImageHeader *header);
64const FlashDriver *bootGetSlotDriver(const Slot *slot);
65
66// C++ guard
67#ifdef __cplusplus
68}
69#endif
70#endif //_SECOND_STAGE_BOOT_COMMON_H
Error codes description.
cboot_error_t
Error codes.
Definition cboot_error.h:57
cboot_error_t bootCheckImage(BootContext *context)
Verify the whole-image CRC32 integrity of the installed 2nd stage bootloader.
Definition boot_common.c:52
CycloneBOOT Image management.
CycloneBOOT 2nd Stage Bootloader management.
BootState
Bootloader States definition.
Definition boot.h:178
cboot_error_t bootUpdateApp(BootContext *context, Slot *slot)
Update current application. Basically it decrypt/copy an image from the external flash memory into th...
Definition boot_common.c:647
cboot_error_t bootCheckRuntimeImage(BootContext *context, Slot *slot)
Check signature or integrity of current running image.
Definition boot_common.c:1135
cboot_error_t bootCheckSlotAppResetVector(Slot *slot)
Check reset vector of the current application firmware binary.
Definition boot_common.c:1224
cboot_error_t bootGetSlotImgHeader(Slot *slot, ImageHeader *header)
Get header from the image inside the given slot.
Definition boot_common.c:1183
cboot_error_t bootSelectRepairImageSlot(BootContext *context, Slot *selectedSlot)
Select a slot holding an image that can repair the running application. Accepts an equal image index,...
Definition boot_common.c:364
cboot_error_t bootInitSecondaryMem(BootContext *context, BootSettings *settings)
Initialize bootloader secondary (external) flash memory.
Definition boot_common.c:237
void bootChangeState(BootContext *context, BootState newState)
Update Bootloader state.
Definition boot_common.c:1265
cboot_error_t bootBackupCurrentApp(BootContext *context, Slot *updateSlot)
Back up the running application before an update is installed. The copy is written as is....
Definition boot_common.c:568
const FlashDriver * bootGetSlotDriver(const Slot *slot)
Resolve the flash driver backing a slot.
Definition boot_common.c:88
cboot_error_t bootInitPrimaryMem(BootContext *context, BootSettings *settings)
Intialize bootloader primary flash memory.
Definition boot_common.c:102
cboot_error_t bootReadbackVerifyImage(Slot *slot)
Read back and verify the image just installed in the given slot. Re-reads the slot from flash and re-...
Definition boot_common.c:911
First-stage bootloader context.
Definition boot.h:136
First-stage bootloader user settings.
Definition boot.h:118
Flash Driver definition.
Definition flash.h:187
Slot Type definition.
Definition memory.h:181