MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mcci_bootloader_board_catena_1sj.h
Go to the documentation of this file.
1/*
2
3Module: mcci_bootloader_board_catena_1sj.h
4
5Function:
6 Top-level platform interface for MCCI Catenas based on the
7 Murata type-1SJ module with the STM32L0.
8
9Copyright and License:
10 This file copyright (C) 2026 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 May 2026
20
21*/
22
23#ifndef _mcci_bootloader_board_catena_1sj_h_
24#define _mcci_bootloader_board_catena_1sj_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_1sj_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_1SJ_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_1SJ_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_1SJ_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
122
127
128McciBootloaderBoard_Catena1sj_Eeprom_t *
130
132
133#endif /* _mcci_bootloader_board_catena_1sj_h_ */
McciBootloaderPlatform_GetMillisecondsFn_t McciBootloaderBoard_Catena1sj_getMilliseconds
McciBootloaderPlatform_DelayMsFn_t McciBootloaderBoard_Catena1sj_delayMs
McciBootloaderPlatform_GetFallbackStorageAddressFn_t McciBootloaderBoard_Catena1sj_getFallbackStorageAddress
McciBootloaderPlatform_AnnunciatorInitFn_t McciBootloaderBoard_Catena1sj_annunciatorInit
McciBootloaderPlatform_GetPrimaryStorageAddressFn_t McciBootloaderBoard_Catena1sj_getPrimaryStorageAddress
McciBootloaderPlatform_SystemInitFn_t McciBootloaderBoard_Catena1sj_systemInit
void McciBootloaderBoard_Catena1sj_setLed(void)
McciBootloaderPlatform_PrepareForLaunchFn_t McciBootloaderBoard_Catena1sj_prepareForLaunch
McciBootloaderPlatform_SpiInitFn_t McciBootloaderBoard_Catena1sj_spiInit
McciBootloaderPlatform_AnnunciatorIndicateStateFn_t McciBootloaderBoard_Catena1sj_annunciatorIndicateState
void McciBootloaderBoard_Catena1sj_annunciatorHandleSysTick(void)
void McciBootloaderBoard_Catena1sj_handleSysTick(void)
McciBootloaderPlatform_SetUpdateFlagFn_t McciBootloaderBoard_Catena1sj_setUpdate
McciBootloaderPlatform_StorageReadFn_t McciBootloaderBoard_Catena1sj_storageRead
void McciBootloaderBoard_Catena1sj_clearLed(void)
McciBootloaderPlatform_SpiTransferFn_t McciBootloaderBoard_Catena1sj_spiTransfer
McciBootloaderPlatform_FailFn_t MCCI_BOOTLOADER_NORETURN_PFX McciBootloaderBoard_Catena1sj_fail MCCI_BOOTLOADER_NORETURN_SFX
McciBootloaderPlatform_GetUpdateFlagFn_t McciBootloaderBoard_Catena1sj_getUpdate
McciBootloaderBoard_Catena1sj_Eeprom_t * McciBootloaderBoard_Catena1sj_getEepromPointer(void)
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
McciBootloader_Milliseconds_t() McciBootloaderPlatform_GetMillisecondsFn_t(void)
get current millisecond tick count
#define MCCI_BOOTLOADER_BEGIN_DECLS
#define MCCI_BOOTLOADER_END_DECLS
#define MCCI_BOOTLOADER_NORETURN_PFX
void McciBootloaderBoard_Catena1sj_fail(McciBootloaderError_t errorCode)