ï‚· FLASH_EraseAllPages()
ï‚· FLASH_ProgramWord()
ï‚· FLASH_ProgramHalfWord()
11.2.4 Option Bytes Programming functions
This group includes the following functions:
ï‚· void FLASH_OB_Unlock(void);
ï‚· void FLASH_OB_Lock(void);
ï‚· void FLASH_OB_Erase(void);
ï‚· FLASH_Status FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState
NewState);
ï‚· FLASH_Status FLASH_OB_RDPConfig(uint8_t OB_RDP);
ï‚· FLASH_Status FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP,
uint8_t OB_STDBY);
ï‚· FLASH_Status FLASH_OB_BOOTConfig(uint8_t OB_BOOT1);
ï‚· FLASH_Status FLASH_OB_VDDAConfig(uint8_t OB_VDDA_ANALOG);
ï‚· FLASH_Status FLASH_OB_SRMParityConfig(uint8_t OB_SRAM_Parity);
ï‚· FLASH_Status FLASH_OB_WriteUser(uint8_t OB_USER);
ï‚· FLASH_Status FLASH_OB_Launch(void);
ï‚· uint32_t FLASH_OB_GetUser(void);
ï‚· uint8_t FLASH_OB_GetWRP(void);
ï‚· uint8_t FLASH_OB_GetRDP(void);
Any operation of erase or program should follow these steps:
1. Call the FLASH_OB_Unlock() function to enable the FLASH option control register
access.
2. Call one or several functions to program the desired Option Bytes:
ï€ void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState); =>
to Enable/Disable the desired sector write protection.
ï€ FLASH_Status FLASH_OB_RDPConfig(uint8_t OB_RDP) => to set the desired
read Protection Level.
ï€ FLASH_Status FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP,
uint8_t OB_STDBY); => to configure the user Option Bytes.
ï€ FLASH_Status FLASH_OB_BOOTConfig(uint8_t OB_BOOT1); => to set the
boot1 mode
ï€ FLASH_Status FLASH_OB_VDDAConfig(uint8_t OB_VDDA_ANALOG); => to
Enable/Disable the VDDA monotoring.
ï€ FLASH_Status FLASH_OB_SRMParityConfig(uint8_t OB_SRAM_Parity); => to
Enable/Disable the SRAM Parity check.
ï€ FLASH_Status FLASH_OB_WriteUser(uint8_t OB_USER); => to write all user
option bytes: OB_IWDG, OB_STOP, OB_STDBY, OB_BOOT1,
OB_VDDA_ANALOG and OB_VDD_SD12.
3. Once all needed Option Bytes to be programmed are correctly written, call the
FLASH_OB_Launch() function to launch the Option Bytes programming process. (#@)
When changing the IWDG mode from HW to SW or from SW to HW, a system reset is
needed to make the change effective.
4. Call the FLASH_OB_Lock() function to disable the FLASH option control register
access (recommended to protect the Option Bytes against possible unwanted
operations).
ï‚· FLASH_OB_Unlock()
ï‚· FLASH_OB_Lock()