STM32F103xB HAL User Manual
Functions
Option Bytes Programming functions
FLASHEx Exported Functions

Option Bytes Programming functions. More...

Functions

HAL_StatusTypeDef HAL_FLASHEx_OBErase (void)
 Erases the FLASH option bytes.
HAL_StatusTypeDef HAL_FLASHEx_OBProgram (FLASH_OBProgramInitTypeDef *pOBInit)
 Program option bytes.
void HAL_FLASHEx_OBGetConfig (FLASH_OBProgramInitTypeDef *pOBInit)
 Get the Option byte configuration.
uint32_t HAL_FLASHEx_OBGetUserData (uint32_t DATAAdress)
 Get the Option byte user data.

Detailed Description

Option Bytes Programming functions.

  ==============================================================================
                ##### Option Bytes Programming functions ##### 
  ==============================================================================  
    [..]
    This subsection provides a set of functions allowing to control the FLASH 
    option bytes operations.


Function Documentation

HAL_StatusTypeDef HAL_FLASHEx_OBErase ( void  )

Erases the FLASH option bytes.

Note:
This functions erases all option bytes except the Read protection (RDP). 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)
Return values:
HALstatus

Definition at line 397 of file stm32f1xx_hal_flash_ex.c.

References FLASH_ProcessTypeDef::ErrorCode, FLASH_OB_GetRDP(), FLASH_OB_RDP_LevelConfig(), FLASH_TIMEOUT_VALUE, FLASH_WaitForLastOperation(), HAL_FLASH_ERROR_NONE, and OB_RDP_LEVEL_0.

Referenced by FLASH_OB_DisableWRP(), and FLASH_OB_EnableWRP().

Get the Option byte configuration.

Parameters:
pOBInitpointer to an FLASH_OBInitStruct structure that contains the configuration information for the programming.
Return values:
None

Definition at line 527 of file stm32f1xx_hal_flash_ex.c.

References FLASH_OB_GetRDP(), FLASH_OB_GetUser(), FLASH_OB_GetWRP(), OPTIONBYTE_RDP, OPTIONBYTE_USER, OPTIONBYTE_WRP, FLASH_OBProgramInitTypeDef::OptionType, FLASH_OBProgramInitTypeDef::RDPLevel, FLASH_OBProgramInitTypeDef::USERConfig, and FLASH_OBProgramInitTypeDef::WRPPage.

uint32_t HAL_FLASHEx_OBGetUserData ( uint32_t  DATAAdress)

Get the Option byte user data.

Parameters:
DATAAdressAddress of the option byte DATA This parameter can be one of the following values:
Return values:
Valueprogrammed in USER data

Definition at line 549 of file stm32f1xx_hal_flash_ex.c.

References FLASH_POSITION_OB_USERDATA0_BIT, FLASH_POSITION_OB_USERDATA1_BIT, and OB_DATA_ADDRESS_DATA0.

HAL_StatusTypeDef HAL_FLASHEx_OBProgram ( FLASH_OBProgramInitTypeDef pOBInit)

Program option bytes.

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)
Parameters:
pOBInitpointer to an FLASH_OBInitStruct structure that contains the configuration information for the programming.
Return values:
HAL_StatusTypeDefHAL Status

Definition at line 446 of file stm32f1xx_hal_flash_ex.c.

References assert_param, FLASH_OBProgramInitTypeDef::DATAAddress, FLASH_OBProgramInitTypeDef::DATAData, FLASH_OB_DisableWRP(), FLASH_OB_EnableWRP(), FLASH_OB_ProgramData(), FLASH_OB_RDP_LevelConfig(), FLASH_OB_UserConfig(), IS_OPTIONBYTE, IS_WRPSTATE, OB_WRPSTATE_ENABLE, OPTIONBYTE_DATA, OPTIONBYTE_RDP, OPTIONBYTE_USER, OPTIONBYTE_WRP, FLASH_OBProgramInitTypeDef::OptionType, FLASH_OBProgramInitTypeDef::RDPLevel, FLASH_OBProgramInitTypeDef::USERConfig, FLASH_OBProgramInitTypeDef::WRPPage, and FLASH_OBProgramInitTypeDef::WRPState.