STM32F103xB HAL User Manual
Functions
FLASHEx Private Functions
FLASHEx

Functions

static void FLASH_MassErase (uint32_t Banks)
 Full erase of FLASH memory Bank.
void FLASH_PageErase (uint32_t PageAddress)
 Erase the specified FLASH memory page.
static HAL_StatusTypeDef FLASH_OB_EnableWRP (uint32_t WriteProtectPage)
 Enable the write protection of the desired pages.
static HAL_StatusTypeDef FLASH_OB_DisableWRP (uint32_t WriteProtectPage)
 Disable the write protection of the desired pages.
static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig (uint8_t ReadProtectLevel)
 Set the read protection level.
static HAL_StatusTypeDef FLASH_OB_UserConfig (uint8_t UserConfig)
 Program the FLASH User Option Byte.
static HAL_StatusTypeDef FLASH_OB_ProgramData (uint32_t Address, uint8_t Data)
 Programs a half word at a specified Option Byte Data address.
static uint32_t FLASH_OB_GetWRP (void)
 Return the FLASH Write Protection Option Bytes value.
static uint32_t FLASH_OB_GetRDP (void)
 Returns the FLASH Read Protection level.
static uint8_t FLASH_OB_GetUser (void)
 Return the FLASH User Option Byte value.

Function Documentation

static void FLASH_MassErase ( uint32_t  Banks) [static]

Full erase of FLASH memory Bank.

Parameters:
BanksBanks to be erased This parameter can be one of the following values:
Return values:
None

Definition at line 595 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, HAL_FLASH_ERROR_NONE, and IS_FLASH_BANK.

Referenced by HAL_FLASHEx_Erase(), and HAL_FLASHEx_Erase_IT().

static HAL_StatusTypeDef FLASH_OB_DisableWRP ( uint32_t  WriteProtectPage) [static]

Disable the write protection of the desired pages.

Note:
An option byte erase is done automatically in this function.
When the memory read protection level is selected (RDP level = 1), it is not possible to program or erase the flash page i if debug features are connected or boot code is executed in RAM, even if nWRPi = 1
Parameters:
WriteProtectPagespecifies the page(s) to be write unprotected. The value of this parameter depend on device used within the same series
Return values:
HALstatus

Definition at line 767 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, FLASH_OB_GetWRP(), FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, HAL_FLASHEx_OBErase(), IS_OB_WRP, OB_WRP_PAGES0TO31MASK, OB_WRP_PAGES32TO63MASK, OB_WRP_PAGES64TO95MASK, and OB_WRP_PAGES96TO127MASK.

Referenced by HAL_FLASHEx_OBProgram().

static HAL_StatusTypeDef FLASH_OB_EnableWRP ( uint32_t  WriteProtectPage) [static]

Enable the write protection of the desired pages.

Note:
An option byte erase is done automatically in this function.
When the memory read protection level is selected (RDP level = 1), it is not possible to program or erase the flash page i if debug features are connected or boot code is executed in RAM, even if nWRPi = 1
Parameters:
WriteProtectPagespecifies the page(s) to be write protected. The value of this parameter depend on device used within the same series
Return values:
HALstatus

Definition at line 644 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, FLASH_OB_GetWRP(), FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, HAL_FLASHEx_OBErase(), IS_OB_WRP, OB_WRP_PAGES0TO31MASK, OB_WRP_PAGES32TO63MASK, OB_WRP_PAGES64TO95MASK, and OB_WRP_PAGES96TO127MASK.

Referenced by HAL_FLASHEx_OBProgram().

static uint32_t FLASH_OB_GetRDP ( void  ) [static]

Returns the FLASH Read Protection level.

Return values:
FLASHRDP level This parameter can be one of the following values:

Definition at line 1034 of file stm32f1xx_hal_flash_ex.c.

References OB_RDP_LEVEL_0, and OB_RDP_LEVEL_1.

Referenced by HAL_FLASHEx_OBErase(), and HAL_FLASHEx_OBGetConfig().

static uint8_t FLASH_OB_GetUser ( void  ) [static]

Return the FLASH User Option Byte value.

Return values:
TheFLASH User Option Bytes values: FLASH_OBR_IWDG_SW(Bit2), FLASH_OBR_nRST_STOP(Bit3),FLASH_OBR_nRST_STDBY(Bit4). And FLASH_OBR_BFB2(Bit5) for STM32F101xG and STM32F103xG .

Definition at line 1060 of file stm32f1xx_hal_flash_ex.c.

References FLASH_POSITION_IWDGSW_BIT.

Referenced by HAL_FLASHEx_OBGetConfig().

static uint32_t FLASH_OB_GetWRP ( void  ) [static]

Return the FLASH Write Protection Option Bytes value.

Return values:
TheFLASH Write Protection Option Bytes value

Definition at line 1021 of file stm32f1xx_hal_flash_ex.c.

Referenced by FLASH_OB_DisableWRP(), FLASH_OB_EnableWRP(), and HAL_FLASHEx_OBGetConfig().

static HAL_StatusTypeDef FLASH_OB_ProgramData ( uint32_t  Address,
uint8_t  Data 
) [static]

Programs a half word at a specified Option Byte Data address.

Note:
The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface The function HAL_FLASH_OB_Unlock() should be called before to unlock the options bytes The function HAL_FLASH_OB_Launch() should be called after to force the reload of the options bytes (system reset will occur) Programming of the OB should be performed only after an erase (otherwise PGERR occurs)
Parameters:
Addressspecifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806.
Dataspecifies the data to be programmed.
Return values:
HALstatus

Definition at line 988 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, and IS_OB_DATA_ADDRESS.

Referenced by HAL_FLASHEx_OBProgram().

static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig ( uint8_t  ReadProtectLevel) [static]

Set the read protection level.

Parameters:
ReadProtectLevelspecifies the read protection level. This parameter can be one of the following values:
Return values:
HALstatus

Definition at line 886 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, and IS_OB_RDP_LEVEL.

Referenced by HAL_FLASHEx_OBErase(), and HAL_FLASHEx_OBProgram().

static HAL_StatusTypeDef FLASH_OB_UserConfig ( uint8_t  UserConfig) [static]

Program the FLASH User Option Byte.

Note:
Programming of the OB should be performed only after an erase (otherwise PGERR occurs)
Parameters:
UserConfigThe FLASH User Option Bytes values FLASH_OBR_IWDG_SW(Bit2), FLASH_OBR_nRST_STOP(Bit3),FLASH_OBR_nRST_STDBY(Bit4). And BFBF2(Bit5) for STM32F101xG and STM32F103xG .
Return values:
HALstatus

Definition at line 937 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_ProcessTypeDef::ErrorCode, FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, IS_OB_IWDG_SOURCE, IS_OB_STDBY_SOURCE, IS_OB_STOP_SOURCE, OB_IWDG_SW, OB_STDBY_NO_RST, and OB_STOP_NO_RST.

Referenced by HAL_FLASHEx_OBProgram().

void FLASH_PageErase ( uint32_t  PageAddress)

Erase the specified FLASH memory page.

Parameters:
PageAddressFLASH page to erase The value of this parameter depend on device used within the same series
Return values:
None

Definition at line 1089 of file stm32f1xx_hal_flash_ex.c.

References FLASH_ProcessTypeDef::ErrorCode, and HAL_FLASH_ERROR_NONE.

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