Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

FLASHEx Private Functions

FLASHEx Private Functions
[FLASHEx]

Functions

static void FLASH_MassErase (uint32_t Banks)
 Full erase of FLASH memory Bank.
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:

  • FLASH_BANK_1 Bank1 to be erased
Return values:
None

Definition at line 612 of file stm32f1xx_hal_flash_ex.c.

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 780 of file stm32f1xx_hal_flash_ex.c.

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 657 of file stm32f1xx_hal_flash_ex.c.

static uint32_t FLASH_OB_GetRDP ( void   ) [static]

Returns the FLASH Read Protection level.

Return values:
FLASHReadOut Protection Status: This parameter can be one of the following values:

  • OB_RDP_LEVEL_0 No protection
  • OB_RDP_LEVEL_1 Read protection of the memory

Definition at line 1047 of file stm32f1xx_hal_flash_ex.c.

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 1073 of file stm32f1xx_hal_flash_ex.c.

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 1034 of file stm32f1xx_hal_flash_ex.c.

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 1001 of file stm32f1xx_hal_flash_ex.c.

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:

  • OB_RDP_LEVEL_0 No protection
  • OB_RDP_LEVEL_1 Read protection of the memory
Return values:
HALstatus

Definition at line 899 of file stm32f1xx_hal_flash_ex.c.

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 950 of file stm32f1xx_hal_flash_ex.c.