CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
boot_trigger.h
Go to the documentation of this file.
1
31#ifndef _STANDALONE_BOOT_TRIGGER_H
32#define _STANDALONE_BOOT_TRIGGER_H
33
34// Dependencies
35#include "boot_config.h"
36#include "core/cboot_error.h"
37#include "core/mcu.h"
38#include "os_port.h"
39
40// Maximum number of triggers evaluated in one boot
41#define BOOT_MAX_TRIGGERS 5
42
43// C++ guard
44#ifdef __cplusplus
45extern "C"
46{
47#endif
48
59
64typedef struct
65{
66 UpdateEntryMode mode;
67 uint32_t windowMs;
69
70// Trigger related functions
73
74// Replaceable hooks
76 UpdateEntryRequest *result);
77bool_t bootTriggerGpioActiveHook(void);
78bool_t bootTriggerNoAppHook(void);
79
80// C++ guard
81#ifdef __cplusplus
82}
83#endif
84#endif //_STANDALONE_BOOT_TRIGGER_H
UpdateEntryMode
Update entry mode.
Definition boot_trigger.h:54
@ UPDATE_ENTRY_NONE
Boot the resident image.
Definition boot_trigger.h:55
@ UPDATE_ENTRY_WINDOW
Listen for a window, then boot.
Definition boot_trigger.h:56
@ UPDATE_ENTRY_REQUIRED
Receive an update now.
Definition boot_trigger.h:57
bool_t bootTriggerGpioActiveHook(void)
GPIO trigger status callback. It is declared weak and must be implemented in the user code space.
Definition boot_trigger.c:159
cboot_error_t bootTriggerGetRequest(UpdateEntryRequest *request)
Collects every enabled trigger and arbitrates between them.
Definition boot_trigger.c:55
cboot_error_t bootTriggerArbitrateHook(const UpdateEntryRequest *requests, size_t count, UpdateEntryRequest *result)
Arbitrates between the collected trigger requests. The default keeps the strongest request,...
Definition boot_trigger.c:124
bool_t bootTriggerNoAppHook(void)
No-application trigger status callback. It is declared weak and must be implemented in the user code ...
Definition boot_trigger.c:171
cboot_error_t bootTriggerInit(void)
Initializes the enabled update entry triggers.
Definition boot_trigger.c:43
Error codes description.
cboot_error_t
Error codes.
Definition cboot_error.h:57
CycloneBOOT MCU layer.
Update entry request.
Definition boot_trigger.h:65
uint32_t windowMs
UPDATE_ENTRY_WINDOW only.
Definition boot_trigger.h:67