MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderboard_stm32h7b3i_dk_storage.c
Go to the documentation of this file.
1/*
2
3Module: mccibootloaderboard_stm32h7b3i_dk_storage.c
4
5Function:
6 Storage driver for STM32H7B3I_DK boards
7
8Copyright and License:
9 This file copyright (C) 2021 by
10
11 MCCI Corporation
12 3520 Krums Corners Road
13 Ithaca, NY 14850
14
15 See accompanying LICENSE file for copyright and license information.
16
17Author:
18 ChaeHee Won, MCCI Corporation June 2021
19
20*/
21
23#include <string.h>
24
25/****************************************************************************\
26|
27| Manifest constants & typedefs.
28|
29\****************************************************************************/
30
31
32/****************************************************************************\
33|
34| Read-only data.
35|
36\****************************************************************************/
37
38
39
40/****************************************************************************\
41|
42| Variables.
43|
44\****************************************************************************/
45
53
61
62void
68
69/*
70
71Name: McciBootloaderBoard_Stm32h7b3iDk_storageRead()
72
73Function:
74 Read a buffer from the specified flash byte address
75
76Definition:
77 bool McciBootloaderBoard_Stm32h7b3iDk_storageRead(
78 McciBootloaderStorageAddress_t Address,
79 uint8_t *pBuffer,
80 size_t nBuffer
81 );
82
83Description:
84 This function reads a buffer from the specified flash
85 byte offset. There are no alignment constraints.
86
87Returns:
88 true if success
89
90*/
91
92bool
95 uint8_t *pBuffer,
96 size_t nBuffer
97 )
98 {
99 if (! MCCI_STM32H7_FLASH_IS_VALID(Address))
100 return false;
101
102 memcpy(pBuffer, (void *) Address, nBuffer);
103 return true;
104 }
105
106/**** end of mccibootloaderboard_stm32h7b3i_dk_storage.c ****/
const uint8_t gk_McciBootloaderBoard_Stm32h7b3iDk_UpdateImageBase[]
base address of the update image in flash bank 2.
const uint8_t gk_McciBootloaderBoard_Stm32h7b3iDk_FallbackImageBase[]
base address of the fallback image (bank 2, 512k to 1024k).
McciBootloaderPlatform_StorageReadFn_t McciBootloaderBoard_Stm32h7b3iDk_storageRead
uint32_t McciBootloaderStorageAddress_t
Abstract type for storage byte addresses.
#define MCCI_STM32H7_FLASH_IS_VALID(f)
McciBootloaderStorageAddress_t McciBootloaderBoard_Stm32h7b3iDk_getFallbackStorageAddress(void)
McciBootloaderStorageAddress_t McciBootloaderBoard_Stm32h7b3iDk_getPrimaryStorageAddress(void)
void McciBootloaderBoard_Stm32h7b3iDk_storageInit(void)