MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderboard_catena5230_storageinit.c
Go to the documentation of this file.
1/*
2
3Module: mccibootloaderboard_catena5230_storageinit.c
4
5Function:
6 McciBootloaderBoard_Catena5230_storageInit()
7
8Copyright and License:
9 This file copyright (C) 2026 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 Terry Moore, MCCI Corporation July 2026
19
20*/
21
23
24#include "mcci_bootloader.h"
25#include "mcci_bootloader_device_npm1300.h"
27#include "mcci_npm1300.h"
28␌
29/****************************************************************************\
30|
31| Manifest constants & typedefs.
32|
33\****************************************************************************/
34
35
36
37/****************************************************************************\
38|
39| Read-only data.
40|
41\****************************************************************************/
42
43
44
45/****************************************************************************\
46|
47| Variables.
48|
49\****************************************************************************/
50
51␌
52/*
53
54Name: McciBootloaderBoard_Catena5230_storageInit()
55
56Function:
57 Initialize the Catena5230 external storage.
58
59Definition:
60 typedef McciBootloaderPlatform_StorageInit_t
61 McciBootloaderBoard_Catena5230_storageInit;
62
63 void McciBootloaderBoard_Catena5230_storageInit(
64 void
65 );
66
67Description:
68 Initialize SPI, init the external flash, and we're ready.
69
70Returns:
71 No explicit result.
72
73Notes:
74
75
76*/
77
78void
80 void
81 )
82 {
83 static const McciBootloaderDevice_NPM1300_Init_t ldsw2_enable[] =
84 {
85 { .address = MCCI_PMIC_NPM1300_REG_LDSWLDOSEL_2, .value = 0 },
86 { .address = MCCI_PMIC_NPM1300_REG_TASKLDSWSET_2, .value = 1 },
87 };
88
89 // turn on the power supply.
90 McciBootloaderDeviceI2cResult_t const result =
91 McciBootloaderDevice_NPM1300_initializeRegisters(
93 ldsw2_enable,
94 MCCIADK_LENOF(ldsw2_enable)
95 );
96
97 // fail if the I2C transfer failed.
98 if (result != McciBootloaderDeviceI2cResult_OK)
99 {
101 }
102
103 // give the power supply 50ms to turn on.
105
108 }
109
110/**** end of mccibootloaderboard_catena5230_storageinit.c ****/
@ McciBootloaderError_StoragePowerUpFailed
failed to initialize storage power.
McciBootloaderDeviceNpm1300_t * g_McciBootloaderBoard_Catena5230_pNPM1300
McciBootloaderPlatform_StorageInitFn_t McciBootloaderFlash_Mx25v8035f_storageInit
void MCCI_BOOTLOADER_NORETURN_PFX McciBootloaderPlatform_fail(McciBootloaderError_t errorCode) MCCI_BOOTLOADER_NORETURN_SFX
static void McciBootloaderPlatform_delayMs(uint32_t ms)
static void McciBootloaderPlatform_spiInit(void)
void McciBootloaderBoard_Catena5230_storageInit(void)