MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mcci_bootloader_board_catena_abz.h
Go to the documentation of this file.
1/*
2
3Module: mcci_bootloader_board_catena_abz.h
4
5Function:
6 Top-level platform interface for MCCI Catenas based on the
7 Murata type-ABZ module with the STM32L0.
8
9Copyright and License:
10 This file copyright (C) 2021 by
11
12 MCCI Corporation
13 3520 Krums Corners Road
14 Ithaca, NY 14850
15
16 See accompanying LICENSE file for copyright and license information.
17
18Author:
19 Terry Moore, MCCI Corporation March 2021
20
21*/
22
23#ifndef _mcci_bootloader_board_catena_abz_h_
24#define _mcci_bootloader_board_catena_abz_h_ /* prevent multiple includes */
25
26#pragma once
27
28#ifndef _mcci_bootloader_types_h_
30#endif
31
32#ifndef _mcci_bootloader_platform_h_
34#endif
35
36#ifndef _mcci_bootloader_stm32l0_h_
38#endif
39
40#ifndef _mcci_bootloader_board_catena_abz_eeprom_h_
42#endif
43
45
46/****************************************************************************\
47|
48| SPI Flash layout
49|
50\****************************************************************************/
51
52/// \brief the maximum image size is 168k bytes (192k - 20k for the bootloader
53/// and 4k for the mfg page).
54#define MCCI_BOOTLOADER_BOARD_CATENA_ABZ_STORAGE_IMAGE_SIZE \
55 (UINT32_C(168) * 1024)
56
57/// \brief we put the fallback image at 64k to 232k, in case anyone needs
58/// special things in page zero. This also lets you set the WP bit,
59/// clear the TP bit, and set BP bits to 0x03; this will protect the
60/// first 256k against accidental change.
61#define MCCI_BOOTLOADER_BOARD_CATENA_ABZ_STORAGE_FALLBACK_BASE \
62 (UINT32_C(65536))
63
64///
65/// \brief base address of the update image
66///
67/// \details The update block begins at a multiple of 64k to allow use
68/// of 64k erase if desired. We put it at 256k so we can easily
69/// write-protect the fallback image if needed.
70///
71#define MCCI_BOOTLOADER_BOARD_CATENA_ABZ_STORAGE_UPDATE_BASE \
72 (UINT32_C(256) * 1024)
73
74/****************************************************************************\
75|
76| API functions.
77|
78\****************************************************************************/
79
82
85
89
92
95
98
101
104
107
110
113
116
119
123
124McciBootloaderBoard_CatenaAbz_Eeprom_t *
126
128
129#endif /* _mcci_bootloader_board_catena_abz_h_ */
McciBootloaderPlatform_DelayMsFn_t McciBootloaderBoard_CatenaAbz_delayMs
McciBootloaderPlatform_AnnunciatorIndicateStateFn_t McciBootloaderBoard_CatenaAbz_annunciatorIndicateState
McciBootloaderPlatform_GetFallbackStorageAddressFn_t McciBootloaderBoard_CatenaAbz_getFallbackStorageAddress
McciBootloaderPlatform_FailFn_t MCCI_BOOTLOADER_NORETURN_PFX McciBootloaderBoard_CatenaAbz_fail MCCI_BOOTLOADER_NORETURN_SFX
McciBootloaderPlatform_GetUpdateFlagFn_t McciBootloaderBoard_CatenaAbz_getUpdate
McciBootloaderPlatform_AnnunciatorInitFn_t McciBootloaderBoard_CatenaAbz_annunciatorInit
McciBootloaderPlatform_SpiInitFn_t McciBootloaderBoard_CatenaAbz_spiInit
McciBootloaderPlatform_StorageReadFn_t McciBootloaderBoard_CatenaAbz_storageRead
McciBootloaderBoard_CatenaAbz_Eeprom_t * McciBootloaderBoard_CatenaAbz_getEepromPointer(void)
McciBootloaderPlatform_SetUpdateFlagFn_t McciBootloaderBoard_CatenaAbz_setUpdate
void McciBootloaderBoard_CatenaAbz_clearLed(void)
void McciBootloaderBoard_CatenaAbz_handleSysTick(void)
void McciBootloaderBoard_CatenaAbz_setLed(void)
McciBootloaderPlatform_PrepareForLaunchFn_t McciBootloaderBoard_CatenaAbz_prepareForLaunch
McciBootloaderPlatform_SystemInitFn_t McciBootloaderBoard_CatenaAbz_systemInit
McciBootloaderPlatform_GetPrimaryStorageAddressFn_t McciBootloaderBoard_CatenaAbz_getPrimaryStorageAddress
McciBootloaderPlatform_SpiTransferFn_t McciBootloaderBoard_CatenaAbz_spiTransfer
void() McciBootloaderPlatform_FailFn_t(McciBootloaderError_t errorCode)
function for reporting a fatal error
McciBootloaderStorageAddress_t() McciBootloaderPlatform_GetPrimaryStorageAddressFn_t(void)
get the start address of the primary image in the storage
bool() McciBootloaderPlatform_StorageReadFn_t(McciBootloaderStorageAddress_t startAddress, uint8_t *pBuffer, size_t nBuffer)
Read bytes from the storage.
MCCI_BOOTLOADER_BEGIN_DECLS typedef void() McciBootloaderPlatform_SystemInitFn_t(void)
function type for platform intialization function
bool() McciBootloaderPlatform_GetUpdateFlagFn_t(void)
Get the "update flag".
void() McciBootloaderPlatform_SetUpdateFlagFn_t(bool state)
Set the "update flag".
void() McciBootloaderPlatform_SpiTransferFn_t(uint8_t *pRx, const uint8_t *pTx, size_t nBytes, bool fContinue)
send/receive data over the SPI bus
void() McciBootloaderPlatform_AnnunciatorInitFn_t(void)
Initialize the annuciator system.
void() McciBootloaderPlatform_DelayMsFn_t(uint32_t ms)
delay execution
void() McciBootloaderPlatform_SpiInitFn_t(void)
initialize the SPI driver for storage use
void() McciBootloaderPlatform_PrepareForLaunchFn_t(void)
function type for preparing to launch an application
void() McciBootloaderPlatform_AnnunciatorIndicateStateFn_t(McciBootloaderState_t state)
Indicate the current state.
McciBootloaderStorageAddress_t() McciBootloaderPlatform_GetFallbackStorageAddressFn_t(void)
get the start address of the fallback image in the storage
#define MCCI_BOOTLOADER_BEGIN_DECLS
#define MCCI_BOOTLOADER_END_DECLS
#define MCCI_BOOTLOADER_NORETURN_PFX
void McciBootloaderBoard_CatenaAbz_fail(McciBootloaderError_t errorCode)