|
|
@ -53,6 +53,8 @@ |
|
|
|
#include <string.h> |
|
|
|
#include <string.h> |
|
|
|
#include "stm32_util.h" |
|
|
|
#include "stm32_util.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <assert.h> |
|
|
|
|
|
|
|
|
|
|
|
// #pragma GCC optimize("O0")
|
|
|
|
// #pragma GCC optimize("O0")
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -125,6 +127,11 @@ static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(32), KB(32), KB(32 |
|
|
|
#error "Unsupported processor for flash.c" |
|
|
|
#error "Unsupported processor for flash.c" |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef STORAGE_FLASH_PAGE |
|
|
|
|
|
|
|
static_assert(STORAGE_FLASH_PAGE < STM32_FLASH_NPAGES, |
|
|
|
|
|
|
|
"STORAGE_FLASH_PAGE out of range"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// keep a cache of the page addresses
|
|
|
|
// keep a cache of the page addresses
|
|
|
|
#ifndef STM32_FLASH_FIXED_PAGE_SIZE |
|
|
|
#ifndef STM32_FLASH_FIXED_PAGE_SIZE |
|
|
|
static uint32_t flash_pageaddr[STM32_FLASH_NPAGES]; |
|
|
|
static uint32_t flash_pageaddr[STM32_FLASH_NPAGES]; |
|
|
|