STM32H735xx HAL User Manual
Functions
FLASHEx Private Functions
FLASHEx | FLASH Exported Constants

Functions

static void FLASH_MassErase (uint32_t VoltageRange, uint32_t Banks)
 Mass erase of FLASH memory.
static void FLASH_OB_EnableWRP (uint32_t WRPSector, uint32_t Banks)
 Enable the write protection of the desired bank1 or bank 2 sectors.
static void FLASH_OB_DisableWRP (uint32_t WRPSector, uint32_t Banks)
 Disable the write protection of the desired bank1 or bank 2 sectors.
static void FLASH_OB_GetWRP (uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank)
 Get the write protection of the given bank 1 or bank 2 sectors.
static void FLASH_OB_RDPConfig (uint32_t RDPLevel)
 Set the read protection level.
static uint32_t FLASH_OB_GetRDP (void)
 Get the read protection level.
static void FLASH_OB_PCROPConfig (uint32_t PCROPConfig, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks)
 Configure the Proprietary code readout protection of the desired addresses.
static void FLASH_OB_GetPCROP (uint32_t *PCROPConfig, uint32_t *PCROPStartAddr, uint32_t *PCROPEndAddr, uint32_t Bank)
 Get the Proprietary code readout protection configuration on a given Bank.
static void FLASH_OB_BOR_LevelConfig (uint32_t Level)
 Set the BOR Level.
static uint32_t FLASH_OB_GetBOR (void)
 Get the BOR Level.
static void FLASH_OB_UserConfig (uint32_t UserType, uint32_t UserConfig)
 Program the FLASH User Option Byte.
static uint32_t FLASH_OB_GetUser (void)
 Return the FLASH User Option Byte value.
static void FLASH_OB_BootAddConfig (uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
 Set Boot address.
static void FLASH_OB_GetBootAdd (uint32_t *BootAddress0, uint32_t *BootAddress1)
 Get Boot address.
static void FLASH_OB_SecureAreaConfig (uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks)
 Set secure area configuration.
static void FLASH_OB_GetSecureArea (uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank)
 Get secure area configuration.
static void FLASH_CRC_AddSector (uint32_t Sector, uint32_t Bank)
 Add a CRC sector to the list of sectors on which the CRC will be calculated.
static void FLASH_CRC_SelectAddress (uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank)
 Select CRC start and end memory addresses on which the CRC will be calculated.
void FLASH_Erase_Sector (uint32_t Sector, uint32_t Banks, uint32_t VoltageRange)
 Erase the specified FLASH memory sector.

Function Documentation

static void FLASH_CRC_AddSector ( uint32_t  Sector,
uint32_t  Bank 
) [static]

Add a CRC sector to the list of sectors on which the CRC will be calculated.

Parameters:
SectorSpecifies the CRC sector number
BankSpecifies the Bank
Return values:
None

Definition at line 1711 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, and IS_FLASH_SECTOR.

Referenced by HAL_FLASHEx_ComputeCRC().

static void FLASH_CRC_SelectAddress ( uint32_t  CRCStartAddr,
uint32_t  CRCEndAddr,
uint32_t  Bank 
) [static]

Select CRC start and end memory addresses on which the CRC will be calculated.

Parameters:
CRCStartAddrSpecifies the CRC start address
CRCEndAddrSpecifies the CRC end address
BankSpecifies the Bank
Return values:
None

Definition at line 1743 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, and IS_FLASH_PROGRAM_ADDRESS_BANK1.

Referenced by HAL_FLASHEx_ComputeCRC().

void FLASH_Erase_Sector ( uint32_t  Sector,
uint32_t  Banks,
uint32_t  VoltageRange 
)

Erase the specified FLASH memory sector.

Parameters:
SectorFLASH sector to erase This parameter can be a value of FLASH Sectors
BanksBanks to be erased This parameter can be one of the following values:
  • FLASH_BANK_1: Bank1 to be erased
  • FLASH_BANK_2: Bank2 to be erased
  • FLASH_BANK_BOTH: Bank1 and Bank2 to be erased
VoltageRangeThe device program/erase parallelism. This parameter can be one of the following values:
  • FLASH_VOLTAGE_RANGE_1 : Flash program/erase by 8 bits
  • FLASH_VOLTAGE_RANGE_2 : Flash program/erase by 16 bits
  • FLASH_VOLTAGE_RANGE_3 : Flash program/erase by 32 bits
  • FLASH_VOLTAGE_RANGE_4 : Flash program/erase by 64 bits
Return values:
None

Definition at line 925 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK_EXCLUSIVE, IS_FLASH_SECTOR, and IS_VOLTAGERANGE.

Referenced by HAL_FLASH_IRQHandler(), HAL_FLASHEx_Erase(), and HAL_FLASHEx_Erase_IT().

static void FLASH_MassErase ( uint32_t  VoltageRange,
uint32_t  Banks 
) [static]

Mass erase of FLASH memory.

Parameters:
VoltageRangeThe device program/erase parallelism. This parameter can be one of the following values:
  • FLASH_VOLTAGE_RANGE_1 : Flash program/erase by 8 bits
  • FLASH_VOLTAGE_RANGE_2 : Flash program/erase by 16 bits
  • FLASH_VOLTAGE_RANGE_3 : Flash program/erase by 32 bits
  • FLASH_VOLTAGE_RANGE_4 : Flash program/erase by 64 bits
BanksBanks to be erased This parameter can be one of the following values:
  • FLASH_BANK_1: Bank1 to be erased
  • FLASH_BANK_2: Bank2 to be erased
  • FLASH_BANK_BOTH: Bank1 and Bank2 to be erased
Return values:
HALStatus

Definition at line 848 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK, and IS_VOLTAGERANGE.

Referenced by HAL_FLASHEx_Erase(), and HAL_FLASHEx_Erase_IT().

static void FLASH_OB_BootAddConfig ( uint32_t  BootOption,
uint32_t  BootAddress0,
uint32_t  BootAddress1 
) [static]

Set Boot address.

Parameters:
BootOptionBoot address option byte to be programmed, This parameter must be a value of FLASHEx OB BOOT OPTION (OB_BOOT_ADD0, OB_BOOT_ADD1 or OB_BOOT_ADD_BOTH)
BootAddress0Specifies the Boot Address 0
BootAddress1Specifies the Boot Address 1
Return values:
HALStatus

Definition at line 1514 of file stm32h7xx_hal_flash_ex.c.

References assert_param, IS_BOOT_ADDRESS, IS_OB_BOOT_ADD_OPTION, OB_BOOT_ADD0, and OB_BOOT_ADD1.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_BOR_LevelConfig ( uint32_t  Level) [static]

Set the BOR Level.

Parameters:
Levelspecifies the Option Bytes BOR Reset Level. This parameter can be one of the following values:
  • OB_BOR_LEVEL0: Reset level threshold is set to 1.6V
  • OB_BOR_LEVEL1: Reset level threshold is set to 2.1V
  • OB_BOR_LEVEL2: Reset level threshold is set to 2.4V
  • OB_BOR_LEVEL3: Reset level threshold is set to 2.7V
Return values:
None

Definition at line 1482 of file stm32h7xx_hal_flash_ex.c.

References assert_param, and IS_OB_BOR_LEVEL.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_DisableWRP ( uint32_t  WRPSector,
uint32_t  Banks 
) [static]

Disable the write protection of the desired bank1 or bank 2 sectors.

Parameters:
WRPSectorspecifies the sector(s) to disable write protection. This parameter can be one of the following values:
  • WRPSector: A combination of FLASH_OB_WRP_SECTOR_0 to FLASH_OB_WRP_SECTOR_7 or FLASH_OB_WRP_SECTOR_ALL
Banksthe specific bank to apply WRP sectors This parameter can be one of the following values:
  • FLASH_BANK_1: disable WRP on specified bank1 sectors
  • FLASH_BANK_2: disable WRP on specified bank2 sectors
  • FLASH_BANK_BOTH: disable WRP on both bank1 and bank2 specified sectors
Return values:
HALFLASH State

Definition at line 1017 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK, and IS_OB_WRP_SECTOR.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_EnableWRP ( uint32_t  WRPSector,
uint32_t  Banks 
) [static]

Enable the write protection of the desired bank1 or bank 2 sectors.

Parameters:
WRPSectorspecifies the sector(s) to be write protected. This parameter can be one of the following values:
  • WRPSector: A combination of OB_WRP_SECTOR_0 to OB_WRP_SECTOR_7 or OB_WRP_SECTOR_ALL
Banksthe specific bank to apply WRP sectors This parameter can be one of the following values:
  • FLASH_BANK_1: enable WRP on specified bank1 sectors
  • FLASH_BANK_2: enable WRP on specified bank2 sectors
  • FLASH_BANK_BOTH: enable WRP on both bank1 and bank2 specified sectors
Return values:
HALFLASH State

Definition at line 982 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK, and IS_OB_WRP_SECTOR.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_GetBootAdd ( uint32_t *  BootAddress0,
uint32_t *  BootAddress1 
) [static]

Get Boot address.

Parameters:
BootAddress0Specifies the Boot Address 0.
BootAddress1Specifies the Boot Address 1.
Return values:
HALStatus

Definition at line 1552 of file stm32h7xx_hal_flash_ex.c.

Referenced by HAL_FLASHEx_OBGetConfig().

static uint32_t FLASH_OB_GetBOR ( void  ) [static]

Get the BOR Level.

Return values:
TheOption Bytes BOR Reset Level. This parameter can be one of the following values:
  • OB_BOR_LEVEL0: Reset level threshold is set to 1.6V
  • OB_BOR_LEVEL1: Reset level threshold is set to 2.1V
  • OB_BOR_LEVEL2: Reset level threshold is set to 2.4V
  • OB_BOR_LEVEL3: Reset level threshold is set to 2.7V

Definition at line 1499 of file stm32h7xx_hal_flash_ex.c.

Referenced by HAL_FLASHEx_OBGetConfig().

static void FLASH_OB_GetPCROP ( uint32_t *  PCROPConfig,
uint32_t *  PCROPStartAddr,
uint32_t *  PCROPEndAddr,
uint32_t  Bank 
) [static]

Get the Proprietary code readout protection configuration on a given Bank.

Parameters:
PCROPConfigindicates if the PCROP area for the given Bank shall be erased or not when RDP level decreased from Level 1 to Level 0 or after a bank erase with protection removal
PCROPStartAddrgives the start address of the Proprietary code readout protection of the bank
PCROPEndAddrgives the end address of the Proprietary code readout protection of the bank
Bankthe specific bank to apply PCROP protection This parameter can be exclusively one of the following values:
  • FLASH_BANK_1: PCROP on specified bank1 area
  • FLASH_BANK_2: PCROP on specified bank2 area
  • FLASH_BANK_BOTH: is not allowed here
Return values:
None

Definition at line 1446 of file stm32h7xx_hal_flash_ex.c.

References FLASH_BANK_1.

Referenced by HAL_FLASHEx_OBGetConfig().

static uint32_t FLASH_OB_GetRDP ( void  ) [static]

Get the read protection level.

Return values:
RDPLevelspecifies the read protection level. This return value can be one of the following values:
  • OB_RDP_LEVEL_0: No protection
  • OB_RDP_LEVEL_1: Read protection of the memory
  • OB_RDP_LEVEL_2: Full chip protection

Definition at line 1119 of file stm32h7xx_hal_flash_ex.c.

References OB_RDP_LEVEL_0, OB_RDP_LEVEL_1, and OB_RDP_LEVEL_2.

Referenced by HAL_FLASHEx_OBGetConfig().

static void FLASH_OB_GetSecureArea ( uint32_t *  SecureAreaConfig,
uint32_t *  SecureAreaStartAddr,
uint32_t *  SecureAreaEndAddr,
uint32_t  Bank 
) [static]

Get secure area configuration.

Parameters:
SecureAreaConfigindicates if the secure area will be deleted or not when RDP level decreased from Level 1 to Level 0 or during a mass erase.
SecureAreaStartAddrgives the secure area start address
SecureAreaEndAddrgives the secure area end address
BankSpecifies the Bank
Return values:
None

Definition at line 1678 of file stm32h7xx_hal_flash_ex.c.

References FLASH_BANK_1.

Referenced by HAL_FLASHEx_OBGetConfig().

static uint32_t FLASH_OB_GetUser ( void  ) [static]

Return the FLASH User Option Byte value.

Return values:
TheFLASH User Option Bytes values IWDG_SW(Bit4), nRST_STOP_D1(Bit 6), nRST_STDY_D1(Bit 7), FZ_IWDG_STOP(Bit 17), FZ_IWDG_SDBY(Bit 18), ST_RAM_SIZE(Bit[19:20]), SECURITY(Bit 21), IO_HSLV (Bit 29) and SWAP_BANK_OPT(Bit 31).

Definition at line 1363 of file stm32h7xx_hal_flash_ex.c.

Referenced by HAL_FLASHEx_OBGetConfig().

static void FLASH_OB_GetWRP ( uint32_t *  WRPState,
uint32_t *  WRPSector,
uint32_t  Bank 
) [static]

Get the write protection of the given bank 1 or bank 2 sectors.

Parameters:
WRPStategives the write protection state on the given bank. This parameter can be one of the following values:
  • WRPState: OB_WRPSTATE_DISABLE or OB_WRPSTATE_ENABLE
WRPSectorgives the write protected sector(s) on the given bank . This parameter can be one of the following values:
  • WRPSector: A combination of FLASH_OB_WRP_SECTOR_0 to FLASH_OB_WRP_SECTOR_7 or FLASH_OB_WRP_SECTOR_ALL
Bankthe specific bank to apply WRP sectors This parameter can be exclusively one of the following values:
  • FLASH_BANK_1: Get bank1 WRP sectors
  • FLASH_BANK_2: Get bank2 WRP sectors
  • FLASH_BANK_BOTH: note allowed in this functions
Return values:
HALFLASH State

Definition at line 1056 of file stm32h7xx_hal_flash_ex.c.

References FLASH_BANK_1, OB_WRPSTATE_DISABLE, and OB_WRPSTATE_ENABLE.

Referenced by HAL_FLASHEx_OBGetConfig().

static void FLASH_OB_PCROPConfig ( uint32_t  PCROPConfig,
uint32_t  PCROPStartAddr,
uint32_t  PCROPEndAddr,
uint32_t  Banks 
) [static]

Configure the Proprietary code readout protection of the desired addresses.

Note:
To configure the PCROP options, the option lock bit OPTLOCK must be cleared with the call of the HAL_FLASH_OB_Unlock() function.
To validate the PCROP options, the option bytes must be reloaded through the call of the HAL_FLASH_OB_Launch() function.
Parameters:
PCROPConfigspecifies if the PCROP area for the given Bank shall be erased or not when RDP level decreased from Level 1 to Level 0, or after a bank erase with protection removal This parameter must be a value of
  • FLASHEx_OB_PCROP_RDP enumeration
PCROPStartAddrspecifies the start address of the Proprietary code readout protection This parameter can be an address between begin and end of the bank
PCROPEndAddrspecifies the end address of the Proprietary code readout protection This parameter can be an address between PCROPStartAddr and end of the bank
Banksthe specific bank to apply PCROP protection This parameter can be one of the following values:
  • FLASH_BANK_1: PCROP on specified bank1 area
  • FLASH_BANK_2: PCROP on specified bank2 area
  • FLASH_BANK_BOTH: PCROP on specified bank1 and bank2 area (same config will be applied on both banks)
Return values:
None

Definition at line 1397 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK, IS_FLASH_PROGRAM_ADDRESS_BANK1, and IS_OB_PCROP_RDP.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_RDPConfig ( uint32_t  RDPLevel) [static]

Set the read protection level.

Note:
To configure the RDP level, the option lock bit OPTLOCK must be cleared with the call of the HAL_FLASH_OB_Unlock() function.
To validate the RDP level, the option bytes must be reloaded through the call of the HAL_FLASH_OB_Launch() function.
!!! Warning : When enabling OB_RDP level 2 it's no more possible to go back to level 1 or 0 !!!
Parameters:
RDPLevelspecifies the read protection level. This parameter can be one of the following values:
  • OB_RDP_LEVEL_0: No protection
  • OB_RDP_LEVEL_1: Read protection of the memory
  • OB_RDP_LEVEL_2: Full chip protection
Return values:
HALstatus

Definition at line 1102 of file stm32h7xx_hal_flash_ex.c.

References assert_param, and IS_OB_RDP_LEVEL.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_SecureAreaConfig ( uint32_t  SecureAreaConfig,
uint32_t  SecureAreaStartAddr,
uint32_t  SecureAreaEndAddr,
uint32_t  Banks 
) [static]

Set secure area configuration.

Parameters:
SecureAreaConfigspecify if the secure area will be deleted or not when RDP level decreased from Level 1 to Level 0 or during a mass erase.
SecureAreaStartAddrSpecifies the secure area start address
SecureAreaEndAddrSpecifies the secure area end address
Banksthe specific bank to apply Security protection This parameter can be one of the following values:
  • FLASH_BANK_1: Secure area on specified bank1 area
  • FLASH_BANK_2: Secure area on specified bank2 area
  • FLASH_BANK_BOTH: Secure area on specified bank1 and bank2 area (same config will be applied on both banks)
Return values:
None

Definition at line 1636 of file stm32h7xx_hal_flash_ex.c.

References assert_param, FLASH_BANK_1, IS_FLASH_BANK, IS_FLASH_PROGRAM_ADDRESS_BANK1, and IS_OB_SECURE_RDP.

Referenced by HAL_FLASHEx_OBProgram().

static void FLASH_OB_UserConfig ( uint32_t  UserType,
uint32_t  UserConfig 
) [static]

Program the FLASH User Option Byte.

Note:
To configure the user option bytes, the option lock bit OPTLOCK must be cleared with the call of the HAL_FLASH_OB_Unlock() function.
To validate the user option bytes, the option bytes must be reloaded through the call of the HAL_FLASH_OB_Launch() function.
Parameters:
UserTypeThe FLASH User Option Bytes to be modified : a combination of
  • FLASHEx_OB_USER_Type
UserConfigThe FLASH User Option Bytes values: IWDG_SW(Bit4), nRST_STOP_D1(Bit 6), nRST_STDY_D1(Bit 7), FZ_IWDG_STOP(Bit 17), FZ_IWDG_SDBY(Bit 18), ST_RAM_SIZE(Bit[19:20]), SECURITY(Bit 21), IO_HSLV (Bit 29) and SWAP_BANK_OPT(Bit 31).
Return values:
HALstatus

Definition at line 1175 of file stm32h7xx_hal_flash_ex.c.

References assert_param, IS_OB_IWDG1_SOURCE, IS_OB_STDBY_D1_RESET, IS_OB_STDBY_D2_RESET, IS_OB_STOP_D1_RESET, IS_OB_STOP_D2_RESET, IS_OB_USER_IOHSLV, IS_OB_USER_IWDG_STDBY, IS_OB_USER_IWDG_STOP, IS_OB_USER_SECURITY, IS_OB_USER_ST_RAM_SIZE, IS_OB_USER_TYPE, OB_USER_IOHSLV, OB_USER_IWDG1_SW, OB_USER_IWDG_STDBY, OB_USER_IWDG_STOP, OB_USER_NRST_STDBY_D1, OB_USER_NRST_STDBY_D2, OB_USER_NRST_STOP_D1, OB_USER_NRST_STOP_D2, OB_USER_SECURITY, and OB_USER_ST_RAM_SIZE.

Referenced by HAL_FLASHEx_OBProgram().