mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-15 10:58:09 +00:00
chore(core): add storage flash area size checks
[no changelog]
This commit is contained in:
parent
5c101ab800
commit
cd06b5f600
@ -23,6 +23,7 @@
|
||||
|
||||
#include "irq.h"
|
||||
#include "mpu.h"
|
||||
#include "sizedefs.h"
|
||||
|
||||
#include "stm32f4xx_ll_cortex.h"
|
||||
|
||||
@ -74,6 +75,10 @@ mpu_driver_t g_mpu_driver = {
|
||||
|
||||
#define KERNEL_CCMRAM_FB_START (KERNEL_CCMRAM_START - KERNEL_FRAMEBUFFER_SIZE)
|
||||
|
||||
_Static_assert(NORCOW_SECTOR_SIZE == STORAGE_1_MAXSIZE, "norcow misconfigured");
|
||||
_Static_assert(NORCOW_SECTOR_SIZE == STORAGE_2_MAXSIZE, "norcow misconfigured");
|
||||
_Static_assert(NORCOW_SECTOR_SIZE == SIZE_64K, "norcow misconfigured");
|
||||
|
||||
static void mpu_init_fixed_regions(void) {
|
||||
// Regions #0 to #4 are fixed for all targets
|
||||
|
||||
|
@ -124,6 +124,8 @@ static void mpu_set_attributes(void) {
|
||||
}
|
||||
|
||||
#define STORAGE_SIZE NORCOW_SECTOR_SIZE* STORAGE_AREAS_COUNT
|
||||
_Static_assert(NORCOW_SECTOR_SIZE == STORAGE_1_MAXSIZE, "norcow misconfigured");
|
||||
_Static_assert(NORCOW_SECTOR_SIZE == STORAGE_2_MAXSIZE, "norcow misconfigured");
|
||||
|
||||
#if defined STM32U5A9xx
|
||||
#define SRAM_SIZE (SRAM1_SIZE + SRAM2_SIZE + SRAM3_SIZE + SRAM5_SIZE)
|
||||
|
Loading…
Reference in New Issue
Block a user