13#ifdef FLASH_OPTCR_nDBANK
15 return (FLASH->OPTCR & FLASH_OPTCR_nDBANK) == 0;
22 return *
reinterpret_cast<const volatile uint16_t*
>(FLASHSIZE_BASE);
40 }
else if (fs == 2048) {
46 criticalError(
"1MB single bank MCU detected: please clear nDBANK option bit and reinstall FW.");
48 }
else if (fs == 2048) {
53 criticalError(
"Unrecognized flash memory layout db=%d, size=%d", db, fs);
75 if (sector > 7 && sector < 12) {
84 return 16 * 1024 * dbMul;
86 return 64 * 1024 * dbMul;
88 return 128 * 1024 * dbMul;
102#ifdef EFI_FLASH_USE_1500_OF_2MB
124#ifdef EFI_FLASH_USE_1500_OF_2MB
132#ifdef EFI_FLASH_USE_1500_OF_2MB
152 SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
153 PWR->CR1 |= PWR_CR1_PDDS;
154 PWR->CR1 |= PWR_CR1_CSBF;
bool mcuCanFlashWhileRunning()
uintptr_t getFlashAddrSecondCopy()
uintptr_t getFlashAddrFirstCopy()
size_t flashSectorSize(flashsector_t sector)
Get the size of sector.
uint8_t flashsector_t
Index of a sector.
void boardPrepareForStandby()
static uint16_t flashSize()
static DeviceType determineDevice()