MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderboard_catena4801_storageinit.c
Go to the documentation of this file.
1/*
2
3Module: mccibootloaderboard_catena4801_storageinit.c
4
5Function:
6 McciBootloaderBoard_Catena4801_storageInit()
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 Terry Moore, MCCI Corporation March 2021
19
20*/
21
23
26#include "mcci_stm32l0xx.h"
27#include <stdbool.h>
28#include <stdint.h>
29#include <stdlib.h>
30
31/****************************************************************************\
32|
33| Manifest constants & typedefs.
34|
35\****************************************************************************/
36
37static void
38storagePowerOn(void);
39
40/****************************************************************************\
41|
42| Read-only data.
43|
44\****************************************************************************/
45
46
47
48/****************************************************************************\
49|
50| Variables.
51|
52\****************************************************************************/
53
54static void
56 {
57 // enable GPIOH
61 );
62
63 // turn on power to the storage chip (4801) by making PH1 an output and
64 // driving it to a one.
69 );
70
74 );
75
76 // delay 50 ms
78 }
79
80
81void
90
91
92/**** end of mccibootloaderboard_catena4801_storageinit.c ****/
static uint32_t McciArm_putRegOr(uint32_t reg, uint32_t orVal)
or 32-bit values to a cm0plus register
static uint32_t McciArm_putRegMasked(uint32_t reg, uint32_t maskVal, uint32_t modVal)
store to cm0plus register under mask
#define MCCI_BOOTLOADER_FIELD_SET_VALUE(fmask, val)
McciBootloaderPlatform_StorageInitFn_t McciBootloaderFlash_Mx25v8035f_storageInit
static void McciBootloaderPlatform_delayMs(uint32_t ms)
static void McciBootloaderPlatform_spiInit(void)
#define MCCI_STM32L0_GPIO_BSRR_BS_P(p)
compute port-bit set mask for bit p.
#define MCCI_STM32L0_GPIO_BSRR
#define MCCI_STM32L0_GPIO_MODER
#define MCCI_STM32L0_REG_RCC_IOPENR_IOPHEN
#define MCCI_STM32L0_REG_RCC_IOPENR
GPIO clock enable.
#define MCCI_STM32L0_GPIO_MODE_OUT
#define MCCI_STM32L0_REG_GPIOH
Section 9.4.12: GPIO register map (1K)
#define MCCI_STM32L0_GPIO_MODE_P(p)
compute the mask for the mode bits for port bits 0..15
static void storagePowerOn(void)
void McciBootloaderBoard_Catena4801_storageInit(void)