96#ifdef HAL_FLASH_MODULE_ENABLED
103#define FLASH_TIMEOUT_VALUE 50000U
114static void FLASH_MassErase(uint32_t VoltageRange, uint32_t Banks);
115static void FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks);
116static void FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Bank);
117static void FLASH_OB_GetWRP(uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank);
118static void FLASH_OB_RDPConfig(uint32_t RDPLevel);
119static uint32_t FLASH_OB_GetRDP(
void);
120static void FLASH_OB_PCROPConfig(uint32_t PCROConfigRDP, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks);
121static void FLASH_OB_GetPCROP(uint32_t *PCROPConfig, uint32_t *PCROPStartAddr,uint32_t *PCROPEndAddr, uint32_t Bank);
122static void FLASH_OB_BOR_LevelConfig(uint32_t Level);
123static uint32_t FLASH_OB_GetBOR(
void);
124static void FLASH_OB_UserConfig(uint32_t UserType, uint32_t UserConfig);
125static uint32_t FLASH_OB_GetUser(
void);
126static void FLASH_OB_BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1);
127static void FLASH_OB_GetBootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1);
128static void FLASH_OB_SecureAreaConfig(uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks);
129static void FLASH_OB_GetSecureArea(uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank);
130static void FLASH_CRC_AddSector(uint32_t Sector, uint32_t Bank);
131static void FLASH_CRC_SelectAddress(uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank);
133#if defined (DUAL_CORE)
134static void FLASH_OB_CM4BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1);
135static void FLASH_OB_GetCM4BootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1);
138#if defined (FLASH_OTPBL_LOCKBL)
139static void FLASH_OB_OTP_LockConfig(uint32_t OTP_Block);
140static uint32_t FLASH_OB_OTP_GetLock(
void);
143#if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
144static void FLASH_OB_SharedRAM_Config(uint32_t SharedRamConfig);
145static uint32_t FLASH_OB_SharedRAM_GetConfig(
void);
148#if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
149static void FLASH_OB_CPUFreq_BoostConfig(uint32_t FreqBoost);
150static uint32_t FLASH_OB_CPUFreq_GetBoost(
void);
195 uint32_t sector_index;
216#if defined (DUAL_BANK)
218 if((pEraseInit->
Banks & FLASH_BANK_2) == FLASH_BANK_2)
244#if defined (DUAL_BANK)
246 if((pEraseInit->
Banks & FLASH_BANK_2) == FLASH_BANK_2)
260 *SectorError = 0xFFFFFFFFU;
263 for(sector_index = pEraseInit->
Sector; sector_index < (pEraseInit->
NbSectors + pEraseInit->
Sector); sector_index++)
275#if defined (DUAL_BANK)
276 if((pEraseInit->
Banks & FLASH_BANK_2) == FLASH_BANK_2)
289 *SectorError = sector_index;
338#if defined (DUAL_BANK)
340 if((pEraseInit->
Banks & FLASH_BANK_2) == FLASH_BANK_2)
359#if defined (FLASH_CR_OPERRIE)
367#if defined (DUAL_BANK)
368 if((pEraseInit->
Banks & FLASH_BANK_2) == FLASH_BANK_2)
371#if defined (FLASH_CR_OPERRIE)
388#if defined (DUAL_BANK)
389 else if(pEraseInit->
Banks == FLASH_BANK_2)
404#if defined (DUAL_BANK)
454#if defined (DUAL_BANK)
488 FLASH_OB_RDPConfig(pOBInit->
RDPLevel);
510 FLASH_OB_BOR_LevelConfig(pOBInit->
BORLevel);
513#if defined(DUAL_CORE)
515 if((pOBInit->
OptionType & OPTIONBYTE_CM7_BOOTADD) == OPTIONBYTE_CM7_BOOTADD)
521 if((pOBInit->
OptionType & OPTIONBYTE_CM4_BOOTADD) == OPTIONBYTE_CM4_BOOTADD)
523 FLASH_OB_CM4BootAddConfig(pOBInit->CM4BootConfig, pOBInit->CM4BootAddr0, pOBInit->CM4BootAddr1);
539#if defined(FLASH_OTPBL_LOCKBL)
541 if((pOBInit->
OptionType & OPTIONBYTE_OTP_LOCK) == OPTIONBYTE_OTP_LOCK)
543 FLASH_OB_OTP_LockConfig(pOBInit->OTPBlockLock);
547#if defined(FLASH_OPTSR2_TCM_AXI_SHARED)
549 if((pOBInit->
OptionType & OPTIONBYTE_SHARED_RAM) == OPTIONBYTE_SHARED_RAM)
551 FLASH_OB_SharedRAM_Config(pOBInit->SharedRamConfig);
555#if defined(FLASH_OPTSR2_CPUFREQ_BOOST)
557 if((pOBInit->
OptionType & OPTIONBYTE_FREQ_BOOST) == OPTIONBYTE_FREQ_BOOST)
559 FLASH_OB_CPUFreq_BoostConfig(pOBInit->FreqBoostState);
584 pOBInit->
RDPLevel = FLASH_OB_GetRDP();
590 pOBInit->
BORLevel = FLASH_OB_GetBOR();
592#if defined (DUAL_BANK)
612#if defined(DUAL_CORE)
613 pOBInit->
OptionType |= OPTIONBYTE_CM7_BOOTADD | OPTIONBYTE_CM4_BOOTADD;
616 FLASH_OB_GetCM4BootAdd(&(pOBInit->CM4BootAddr0), &(pOBInit->CM4BootAddr1));
621#if defined (FLASH_OTPBL_LOCKBL)
625 pOBInit->OTPBlockLock = FLASH_OB_OTP_GetLock();
628#if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
632 pOBInit->SharedRamConfig = FLASH_OB_SharedRAM_GetConfig();
635#if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
639 pOBInit->FreqBoostState = FLASH_OB_CPUFreq_GetBoost();
676#if defined (DUAL_BANK)
725 uint32_t sector_index;
754 for(sector_index = pCRCInit->
Sector; sector_index < (pCRCInit->
NbSectors + pCRCInit->
Sector); sector_index++)
777 (*CRC_Result) =
FLASH->CRCDATA;
785#if defined (DUAL_BANK)
804 for(sector_index = pCRCInit->
Sector; sector_index < (pCRCInit->
NbSectors + pCRCInit->
Sector); sector_index++)
806 FLASH_CRC_AddSector(sector_index, FLASH_BANK_2);
827 (*CRC_Result) =
FLASH->CRCDATA;
845#if (USE_FLASH_ECC == 1U)
866void HAL_FLASHEx_EnableEccCorrectionInterrupt(
void)
870#if defined (DUAL_BANK)
880void HAL_FLASHEx_DisableEccCorrectionInterrupt(
void)
884#if defined (DUAL_BANK)
894void HAL_FLASHEx_EnableEccCorrectionInterrupt_Bank1(
void)
904void HAL_FLASHEx_DisableEccCorrectionInterrupt_Bank1(
void)
909#if defined (DUAL_BANK)
915void HAL_FLASHEx_EnableEccCorrectionInterrupt_Bank2(
void)
925void HAL_FLASHEx_DisableEccCorrectionInterrupt_Bank2(
void)
936void HAL_FLASHEx_EnableEccDetectionInterrupt(
void)
940#if defined (DUAL_BANK)
950void HAL_FLASHEx_DisableEccDetectionInterrupt(
void)
954#if defined (DUAL_BANK)
964void HAL_FLASHEx_EnableEccDetectionInterrupt_Bank1(
void)
974void HAL_FLASHEx_DisableEccDetectionInterrupt_Bank1(
void)
979#if defined (DUAL_BANK)
985void HAL_FLASHEx_EnableEccDetectionInterrupt_Bank2(
void)
995void HAL_FLASHEx_DisableEccDetectionInterrupt_Bank2(
void)
1009void HAL_FLASHEx_GetEccInfo(FLASH_EccInfoTypeDef *pData)
1017 pData->Area = FLASH_ECC_AREA_USER_BANK1;
1020#if defined (DUAL_BANK)
1025 pData->Area = FLASH_ECC_AREA_USER_BANK2;
1035void HAL_FLASHEx_BusFault_IRQHandler(
void)
1041 HAL_FLASHEx_EccDetectionCallback();
1048#if defined (DUAL_BANK)
1053 HAL_FLASHEx_EccDetectionCallback();
1067__weak
void HAL_FLASHEx_EccCorrectionCallback(
void)
1078__weak
void HAL_FLASHEx_EccDetectionCallback(
void)
1117static void FLASH_MassErase(uint32_t VoltageRange, uint32_t Banks)
1120#if defined (FLASH_CR_PSIZE)
1127#if defined (DUAL_BANK)
1129 if((Banks & FLASH_BANK_BOTH) == FLASH_BANK_BOTH)
1131#if defined (FLASH_CR_PSIZE)
1137 FLASH->CR1 |= VoltageRange;
1138 FLASH->CR2 |= VoltageRange;
1142 FLASH->OPTCR |= FLASH_OPTCR_MER;
1150#if defined (FLASH_CR_PSIZE)
1153 FLASH->CR1 |= VoltageRange;
1160#if defined (DUAL_BANK)
1161 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1163#if defined (FLASH_CR_PSIZE)
1166 FLASH->CR2 |= VoltageRange;
1198#if defined (FLASH_CR_PSIZE)
1206#if defined (FLASH_CR_PSIZE)
1219#if defined (DUAL_BANK)
1220 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1222#if defined (FLASH_CR_PSIZE)
1251static void FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks)
1263#if defined (DUAL_BANK)
1264 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1286static void FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks)
1298#if defined (DUAL_BANK)
1299 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1325static void FLASH_OB_GetWRP(uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank)
1327 uint32_t regvalue = 0U;
1331 regvalue =
FLASH->WPSN_CUR1;
1334#if defined (DUAL_BANK)
1335 if(Bank == FLASH_BANK_2)
1337 regvalue =
FLASH->WPSN_CUR2;
1343 if(*WRPSector == 0U)
1371static void FLASH_OB_RDPConfig(uint32_t RDPLevel)
1388static uint32_t FLASH_OB_GetRDP(
void)
1402#if defined(DUAL_CORE)
1444static void FLASH_OB_UserConfig(uint32_t UserType, uint32_t UserConfig)
1446 uint32_t optr_reg_val = 0;
1447 uint32_t optr_reg_mask = 0;
1461#if defined(DUAL_CORE)
1462 if((UserType & OB_USER_IWDG2_SW) != 0U)
1465 assert_param(IS_OB_IWDG2_SOURCE(UserConfig & FLASH_OPTSR_IWDG2_SW));
1468 optr_reg_val |= (UserConfig & FLASH_OPTSR_IWDG2_SW);
1469 optr_reg_mask |= FLASH_OPTSR_IWDG2_SW;
1532#if defined(DUAL_CORE)
1533 if((UserType & OB_USER_BCM4) != 0U)
1536 assert_param(IS_OB_USER_BCM4(UserConfig & FLASH_OPTSR_BCM4));
1539 optr_reg_val |= (UserConfig & FLASH_OPTSR_BCM4);
1540 optr_reg_mask |= FLASH_OPTSR_BCM4;
1543 if((UserType & OB_USER_BCM7) != 0U)
1546 assert_param(IS_OB_USER_BCM7(UserConfig & FLASH_OPTSR_BCM7));
1549 optr_reg_val |= (UserConfig & FLASH_OPTSR_BCM7);
1550 optr_reg_mask |= FLASH_OPTSR_BCM7;
1554#if defined (FLASH_OPTSR_NRST_STOP_D2)
1555 if((UserType & OB_USER_NRST_STOP_D2) != 0U)
1565 if((UserType & OB_USER_NRST_STDBY_D2) != 0U)
1576#if defined (DUAL_BANK)
1577 if((UserType & OB_USER_SWAP_BANK) != 0U)
1580 assert_param(IS_OB_USER_SWAP_BANK(UserConfig & FLASH_OPTSR_SWAP_BANK_OPT));
1583 optr_reg_val |= (UserConfig & FLASH_OPTSR_SWAP_BANK_OPT);
1584 optr_reg_mask |= FLASH_OPTSR_SWAP_BANK_OPT;
1598#if defined (FLASH_OPTSR_VDDMMC_HSLV)
1599 if((UserType & OB_USER_VDDMMC_HSLV) != 0U)
1602 assert_param(IS_OB_USER_VDDMMC_HSLV(UserConfig & FLASH_OPTSR_VDDMMC_HSLV));
1605 optr_reg_val |= (UserConfig & FLASH_OPTSR_VDDMMC_HSLV);
1606 optr_reg_mask |= FLASH_OPTSR_VDDMMC_HSLV;
1614#if defined(DUAL_CORE)
1632static uint32_t FLASH_OB_GetUser(
void)
1666static void FLASH_OB_PCROPConfig(uint32_t PCROPConfig, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks)
1683#if defined (DUAL_BANK)
1684 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1686 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(PCROPStartAddr));
1687 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(PCROPEndAddr));
1690 FLASH->PRAR_PRG2 = ((PCROPStartAddr - FLASH_BANK2_BASE) >> 8) | \
1715static void FLASH_OB_GetPCROP(uint32_t *PCROPConfig, uint32_t *PCROPStartAddr, uint32_t *PCROPEndAddr, uint32_t Bank)
1717 uint32_t regvalue = 0;
1718 uint32_t bankBase = 0;
1722 regvalue =
FLASH->PRAR_CUR1;
1726#if defined (DUAL_BANK)
1727 if(Bank == FLASH_BANK_2)
1729 regvalue =
FLASH->PRAR_CUR2;
1730 bankBase = FLASH_BANK2_BASE;
1738 (*PCROPEndAddr) = ((*PCROPEndAddr) << 8) + bankBase;
1751static void FLASH_OB_BOR_LevelConfig(uint32_t Level)
1768static uint32_t FLASH_OB_GetBOR(
void)
1783static void FLASH_OB_BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
1794#if defined(DUAL_CORE)
1795 MODIFY_REG(
FLASH->BOOT7_PRG, FLASH_BOOT7_BCM7_ADD0, (BootAddress0 >> 16));
1807#if defined(DUAL_CORE)
1821static void FLASH_OB_GetBootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1)
1825#if defined(DUAL_CORE)
1826 regvalue =
FLASH->BOOT7_CUR;
1828 (*BootAddress0) = (regvalue & FLASH_BOOT7_BCM7_ADD0) << 16;
1829 (*BootAddress1) = (regvalue & FLASH_BOOT7_BCM7_ADD1);
1831 regvalue =
FLASH->BOOT_CUR;
1838#if defined(DUAL_CORE)
1849static void FLASH_OB_CM4BootAddConfig(uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
1860 MODIFY_REG(
FLASH->BOOT4_PRG, FLASH_BOOT4_BCM4_ADD0, (BootAddress0 >> 16));
1880static void FLASH_OB_GetCM4BootAdd(uint32_t *BootAddress0, uint32_t *BootAddress1)
1884 regvalue =
FLASH->BOOT4_CUR;
1886 (*BootAddress0) = (regvalue & FLASH_BOOT4_BCM4_ADD0) << 16;
1887 (*BootAddress1) = (regvalue & FLASH_BOOT4_BCM4_ADD1);
1905static void FLASH_OB_SecureAreaConfig(uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks)
1923#if defined (DUAL_BANK)
1924 if((Banks & FLASH_BANK_2) == FLASH_BANK_2)
1927 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(SecureAreaStartAddr));
1928 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(SecureAreaEndAddr));
1931 FLASH->SCAR_PRG2 = ((SecureAreaStartAddr - FLASH_BANK2_BASE) >> 8) | \
1947static void FLASH_OB_GetSecureArea(uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank)
1949 uint32_t regvalue = 0;
1950 uint32_t bankBase = 0;
1955 regvalue =
FLASH->SCAR_CUR1;
1959#if defined (DUAL_BANK)
1960 if(Bank == FLASH_BANK_2)
1962 regvalue =
FLASH->SCAR_CUR2;
1963 bankBase = FLASH_BANK2_BASE;
1971 (*SecureAreaEndAddr) = ((*SecureAreaEndAddr) << 8) + bankBase;
1980static void FLASH_CRC_AddSector(uint32_t Sector, uint32_t Bank)
1993#if defined (DUAL_BANK)
2012static void FLASH_CRC_SelectAddress(uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank)
2020 FLASH->CRCSADD1 = CRCStartAddr;
2021 FLASH->CRCEADD1 = CRCEndAddr;
2023#if defined (DUAL_BANK)
2026 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(CRCStartAddr));
2027 assert_param(IS_FLASH_PROGRAM_ADDRESS_BANK2(CRCEndAddr));
2030 FLASH->CRCSADD2 = CRCStartAddr;
2031 FLASH->CRCEADD2 = CRCEndAddr;
2039#if defined (FLASH_OTPBL_LOCKBL)
2046static void FLASH_OB_OTP_LockConfig(uint32_t OTP_Block)
2052 FLASH->OTPBL_PRG |= (OTP_Block & FLASH_OTPBL_LOCKBL);
2060static uint32_t FLASH_OB_OTP_GetLock(
void)
2062 return (
FLASH->OTPBL_CUR);
2066#if defined (FLASH_OPTSR2_TCM_AXI_SHARED)
2073static void FLASH_OB_SharedRAM_Config(uint32_t SharedRamConfig)
2076 assert_param(IS_OB_USER_TCM_AXI_SHARED(SharedRamConfig));
2087static uint32_t FLASH_OB_SharedRAM_GetConfig(
void)
2093#if defined (FLASH_OPTSR2_CPUFREQ_BOOST)
2100static void FLASH_OB_CPUFreq_BoostConfig(uint32_t FreqBoost)
2114static uint32_t FLASH_OB_CPUFreq_GetBoost(
void)
#define SET_BIT(REG, BIT)
#define WRITE_REG(REG, VAL)
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
#define READ_BIT(REG, BIT)
#define FLASH_BANK_1
Bank 1.
#define FLASH_CRC_BANK
CRC selection type by bank.
#define FLASH_CRC_SECTORS
CRC selection type by sectors.
HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit)
HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit)
HAL_StatusTypeDef HAL_FLASHEx_ComputeCRC(FLASH_CRCInitTypeDef *pCRCInit, uint32_t *CRC_Result)
HAL_StatusTypeDef HAL_FLASHEx_Unlock_Bank1(void)
HAL_StatusTypeDef HAL_FLASHEx_Lock_Bank1(void)
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit)
#define IS_OB_USER_IWDG_STDBY(VALUE)
#define IS_OB_USER_IWDG_STOP(VALUE)
#define IS_OB_IWDG1_SOURCE(SOURCE)
#define IS_FLASH_TYPECRC(VALUE)
#define IS_OB_USER_TYPE(TYPE)
#define IS_OB_PCROP_RDP(CONFIG)
#define IS_OB_SECURE_RDP(CONFIG)
#define IS_OB_USER_ST_RAM_SIZE(VALUE)
#define IS_WRPSTATE(VALUE)
#define IS_OPTIONBYTE(VALUE)
#define IS_OB_RDP_LEVEL(LEVEL)
#define IS_FLASH_SECTOR(SECTOR)
#define IS_OB_USER_IOHSLV(VALUE)
#define IS_OB_BOOT_ADD_OPTION(VALUE)
#define IS_OB_USER_SECURITY(VALUE)
#define IS_OB_STDBY_D1_RESET(VALUE)
#define IS_OB_BOR_LEVEL(LEVEL)
#define IS_OB_WRP_SECTOR(SECTOR)
#define IS_OB_STOP_D1_RESET(VALUE)
#define IS_FLASH_TYPEERASE(VALUE)
#define OB_BOOT_ADD1
Select Boot Address 1.
#define OB_BOOT_ADD0
Select Boot Address 0.
#define OB_USER_SECURITY
security selection
#define OB_USER_IWDG_STOP
Independent watchdog counter freeze in stop mode.
#define OB_USER_NRST_STOP_D1
Reset when entering Stop mode selection.
#define OB_USER_IWDG_STDBY
Independent watchdog counter freeze in standby mode.
#define OB_USER_ST_RAM_SIZE
dedicated DTCM Ram size selection
#define OB_USER_NRST_STDBY_D1
Reset when entering standby mode selection.
#define OB_USER_IOHSLV
IO HSLV selection.
#define OB_USER_IWDG1_SW
Independent watchdog selection.
#define OB_RDP_LEVEL_2
Warning: When enabling read protection level 2 it s no more possible to go back to level 1 or 0.
#define OPTIONBYTE_BOOTADD
BOOT ADD option byte configuration.
#define OPTIONBYTE_WRP
WRP option byte configuration.
#define OPTIONBYTE_RDP
RDP option byte configuration.
#define OPTIONBYTE_SECURE_AREA
secure area option byte configuration
#define OPTIONBYTE_USER
USER option byte configuration.
#define OPTIONBYTE_PCROP
PCROP option byte configuration.
#define OPTIONBYTE_BOR
BOR option byte configuration.
void FLASH_Erase_Sector(uint32_t Sector, uint32_t Banks, uint32_t VoltageRange)
#define FLASH_TYPEERASE_MASSERASE
Flash Mass erase activation.
#define OB_WRPSTATE_ENABLE
Enable the write protection of the desired bank 1 sectors.
#define OB_WRPSTATE_DISABLE
Disable the write protection of the desired bank 1 sectors.
#define HAL_FLASH_ERROR_NONE
No error.
#define __HAL_FLASH_ENABLE_IT_BANK1(__INTERRUPT__)
Enable the specified FLASH interrupt.
#define __HAL_FLASH_ENABLE_IT_BANK2(__INTERRUPT__)
#define __HAL_FLASH_ENABLE_IT(__INTERRUPT__)
#define __HAL_FLASH_DISABLE_IT(__INTERRUPT__)
#define __HAL_FLASH_CLEAR_FLAG_BANK2(__FLAG__)
#define __HAL_FLASH_CLEAR_FLAG_BANK1(__FLAG__)
Clear the specified FLASH flag.
@ FLASH_PROC_MASSERASE_BANK2
@ FLASH_PROC_MASSERASE_BANK1
@ FLASH_PROC_SECTERASE_BANK2
@ FLASH_PROC_SECTERASE_BANK1
@ FLASH_PROC_ALLBANK_MASSERASE
#define FLASH_FLAG_CRCEND_BANK1
CRC End of Calculation on Bank 1 flag.
#define FLASH_FLAG_DBECCERR_BANK1
Double Detection ECC Error on Bank 1 flag.
#define FLASH_FLAG_CRCRDERR_BANK2
CRC Read error on Bank 2 flag.
#define FLASH_FLAG_DBECCERR_BANK2
Double Detection ECC Error on Bank 2 flag.
#define FLASH_FLAG_CRCRDERR_BANK1
CRC Read error on Bank 1 flag.
#define FLASH_FLAG_CRCEND_BANK2
CRC End of Calculation on Bank 2 flag.
#define FLASH_FLAG_SNECCERR_BANK2
Single ECC Error Correction on Bank 2 flag.
#define FLASH_FLAG_SNECCERR_BANK1
Single ECC Error Correction on Bank 1 flag.
#define FLASH_IT_WRPERR_BANK1
Write Protection Error on Bank 1 Interrupt source.
#define FLASH_IT_WRPERR_BANK2
Write Protection Error on Bank 2 Interrupt source.
#define FLASH_IT_EOP_BANK1
End of FLASH Bank 1 Operation Interrupt source.
#define FLASH_IT_STRBERR_BANK1
Strobe Error on Bank 1 Interrupt source.
#define FLASH_IT_SNECCERR_BANK1
Single ECC Error Correction on Bank 1 Interrupt source.
#define FLASH_IT_SNECCERR_BANK2
Single ECC Error Correction on Bank 2 Interrupt source.
#define FLASH_IT_INCERR_BANK2
Inconsistency Error on Bank 2 Interrupt source.
#define FLASH_IT_PGSERR_BANK1
Program Sequence Error on Bank 1 Interrupt source.
#define FLASH_IT_EOP_BANK2
End of FLASH Bank 2 Operation Interrupt source.
#define FLASH_IT_DBECCERR_BANK2
Double Detection ECC Error on Bank 2 Interrupt source.
#define FLASH_IT_INCERR_BANK1
Inconsistency Error on Bank 1 Interrupt source.
#define FLASH_IT_DBECCERR_BANK1
Double Detection ECC Error on Bank 1 Interrupt source.
#define FLASH_IT_STRBERR_BANK2
Strobe Error on Bank 2 Interrupt source.
#define FLASH_IT_PGSERR_BANK2
Program Sequence Error on Bank 2 Interrupt source.
HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
#define IS_FLASH_BANK(BANK)
#define IS_FLASH_PROGRAM_ADDRESS_BANK1(ADDRESS)
#define IS_FLASH_BANK_EXCLUSIVE(BANK)
#define IS_BOOT_ADDRESS(ADDRESS)
FLASH_ProcessTypeDef pFlash
#define FLASH_OPTSR_IWDG1_SW
IWDG1 control mode option status bit.
#define FLASH_BOOT_ADD0
Arm Cortex-M7 boot address 0.
#define FLASH_OPTSR_NRST_STOP_D1
D1 domain DStop entry reset option status bit.
#define FLASH_OPTSR_SECURITY
Security enable option status bit.
#define FLASH_CRCCR_ADD_SECT
CRC sector select bit.
#define FLASH_CR_CRC_EN
CRC control bit.
#define FLASH_CCR_CLR_CRCEND
CRCEND flag clear bit.
#define FLASH_SCAR_SEC_AREA_START
Secure-only area start status bits.
#define FLASH_NB_32BITWORD_IN_FLASHWORD
#define FLASH_SCAR_SEC_AREA_END
Secure-only area end status bits.
#define FLASH_ECC_FA_FAIL_ECC_ADDR
ECC error address.
#define FLASH_CRCCR_ALL_BANK
CRC select bit.
#define FLASH_OPTSR2_CPUFREQ_BOOST
CPU frequency boost.
#define FLASH_OPTSR_ST_RAM_SIZE
ST RAM size option status.
#define FLASH_CR_SNB
Sector erase selection number.
#define FLASH_OPTSR_NRST_STBY_D1
D1 domain DStandby entry reset option status bit.
#define FLASH_SCAR_DMES
Secure access protected erase enable option status bit.
#define FLASH_CR_BER
Bank erase request.
#define FLASH_OPTSR_FZ_IWDG_SDBY
IWDG Standby mode freeze option status bit.
#define FLASH_CRCCR_START_CRC
CRC start bit.
#define FLASH_OPTSR_BOR_LEV
Brownout level option status bit.
#define FLASH_PRAR_PROT_AREA_END
PCROP area end status bits.
#define FLASH_PRAR_PROT_AREA_START
PCROP area start status bits.
#define FLASH_CRCCR_CRC_BURST_Msk
0x00300000
#define FLASH_BOOT_ADD1
Arm Cortex-M7 boot address 1.
#define FLASH_CRCCR_CRC_SECT
CRC sector number.
#define FLASH_OPTSR2_TCM_AXI_SHARED
TCM RAM shared.
#define FLASH_PRAR_DMEP
PCROP protected erase enable option status bit.
#define FLASH_OPTSR_IO_HSLV
I/O high-speed at low-voltage status bit.
#define FLASH_OPTSR_NRST_STBY_D2
D2 domain DStandby entry reset option status bit.
#define FLASH_CR_PSIZE
Program size.
#define FLASH_CR_START
Erase start control bit.
#define FLASH_PRAR_PROT_AREA_END_Pos
#define FLASH_WPSN_WRPSN
Sector write protection option status byte.
#define FLASH_CR_LOCK
Configuration lock bit.
#define FLASH_SCAR_SEC_AREA_END_Pos
#define FLASH_CRCCR_CLEAN_CRC
CRC clear bit.
#define FLASH_CRCCR_CLEAN_SECT
CRC sector list clear bit.
#define FLASH_OPTSR_NRST_STOP_D2
D2 domain DStop entry reset option status bit.
#define FLASH_OPTSR_RDP
Readout protection level option status byte.
#define FLASH_CCR_CLR_CRCRDERR
CRCRDERR flag clear bit.
#define FLASH_CR_SER
Sector erase request.
#define FLASH_OPTSR_FZ_IWDG_STOP
IWDG Stop mode freeze option status bit.
#define FLASH_BANK1_BASE
Base address of : (up to 1 MB) Flash Bank1 accessible over AXI.
This file contains all the functions prototypes for the HAL module driver.
#define assert_param(expr)
Uncomment the line below to expanse the "assert_param" macro in the HAL drivers code.
HAL_StatusTypeDef
HAL Status structures definition.
#define __HAL_UNLOCK(__HANDLE__)
#define __HAL_LOCK(__HANDLE__)
FLASH Erase structure definition.
uint32_t TypeCRC
CRC Selection Type.
uint32_t BurstSize
CRC Burst Size.
uint32_t CRCStartAddr
CRC Start address.
uint32_t Sector
Initial FLASH sector from which starts the CRC computation This parameter must be a value of FLASH Se...
uint32_t NbSectors
Number of sectors to be computed.
uint32_t Bank
Select bank where CRC computation is enabled.
uint32_t CRCEndAddr
CRC End address.
FLASH Erase structure definition.
uint32_t Sector
Initial FLASH sector to erase when Mass erase is disabled This parameter must be a value of FLASH Sec...
uint32_t VoltageRange
The device voltage range which defines the erase parallelism This parameter must be a value of FLASHE...
uint32_t TypeErase
Mass erase or sector Erase.
uint32_t Banks
Select banks to erase when Mass erase is enabled.
uint32_t NbSectors
Number of sectors to be erased.
FLASH Option Bytes Program structure definition.
uint32_t BootAddr0
Boot Address 0.
uint32_t RDPLevel
Set the read protection level.
uint32_t WRPState
Write protection activation or deactivation.
uint32_t BootAddr1
Boot Address 1.
uint32_t PCROPConfig
specifies if the PCROP area shall be erased or not when RDP level decreased from Level 1 to Level 0 o...
uint32_t SecureAreaConfig
specifies if the bank secured area shall be erased or not when RDP level decreased from Level 1 to Le...
uint32_t OptionType
Option byte to be configured.
uint32_t BORLevel
Set the BOR Level.
uint32_t Banks
Select banks for WRP , PCROP and secure area config .
uint32_t SecureAreaStartAddr
Bank Secure area Start address.
uint32_t USERType
User option byte(s) to be configured (used for OPTIONBYTE_USER).
uint32_t WRPSector
Specifies the sector(s) to be write protected.
uint32_t SecureAreaEndAddr
Bank Secure area End address.
uint32_t BootConfig
Specifies if the Boot Address to be configured BOOT_ADD0, BOOT_ADD1 or both.
uint32_t PCROPStartAddr
PCROP Start address (used for OPTIONBYTE_PCROP).
uint32_t PCROPEndAddr
PCROP End address (used for OPTIONBYTE_PCROP).
uint32_t USERConfig
Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY / IWDG_FREEZE_STOP / IWDG_FREEZE_S...