STM32F479xx HAL User Manual
Defines | Functions | Variables
stm32f4xx_hal_flash_ex.c File Reference

Extended FLASH HAL module driver. This file provides firmware functions to manage the following functionalities of the FLASH extension peripheral: + Extended programming operations functions. More...

#include "stm32f4xx_hal.h"

Go to the source code of this file.

Defines

#define FLASH_TIMEOUT_VALUE   50000U /* 50 s */

Functions

static void FLASH_MassErase (uint8_t VoltageRange, uint32_t Banks)
 Full erase of FLASH memory sectors.
static HAL_StatusTypeDef FLASH_OB_EnableWRP (uint32_t WRPSector, uint32_t Banks)
 Enable the write protection of the desired bank1 or bank 2 sectors.
static HAL_StatusTypeDef FLASH_OB_DisableWRP (uint32_t WRPSector, uint32_t Banks)
 Disable the write protection of the desired bank1 or bank 2 sectors.
static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig (uint8_t Level)
 Set the read protection level.
static HAL_StatusTypeDef FLASH_OB_UserConfig (uint8_t Iwdg, uint8_t Stop, uint8_t Stdby)
 Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
static HAL_StatusTypeDef FLASH_OB_BOR_LevelConfig (uint8_t Level)
 Set the BOR Level.
static uint8_t FLASH_OB_GetUser (void)
 Return the FLASH User Option Byte value.
static uint16_t FLASH_OB_GetWRP (void)
 Return the FLASH Write Protection Option Bytes value.
static uint8_t FLASH_OB_GetRDP (void)
 Returns the FLASH Read Protection level.
static uint8_t FLASH_OB_GetBOR (void)
 Returns the FLASH BOR level.
static HAL_StatusTypeDef FLASH_OB_EnablePCROP (uint32_t SectorBank1, uint32_t SectorBank2, uint32_t Banks)
 Enable the read/write protection (PCROP) of the desired sectors of Bank 1 and/or Bank 2.
static HAL_StatusTypeDef FLASH_OB_DisablePCROP (uint32_t SectorBank1, uint32_t SectorBank2, uint32_t Banks)
 Disable the read/write protection (PCROP) of the desired sectors of Bank 1 and/or Bank 2.
static HAL_StatusTypeDef FLASH_OB_BootConfig (uint8_t BootConfig)
 Configure the Dual Bank Boot.
HAL_StatusTypeDef FLASH_WaitForLastOperation (uint32_t Timeout)
 Wait for a FLASH operation to complete.
HAL_StatusTypeDef HAL_FLASHEx_Erase (FLASH_EraseInitTypeDef *pEraseInit, uint32_t *SectorError)
 Perform a mass erase or erase the specified FLASH memory sectors.
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT (FLASH_EraseInitTypeDef *pEraseInit)
 Perform a mass erase or erase the specified FLASH memory sectors with interrupt enabled.
HAL_StatusTypeDef HAL_FLASHEx_OBProgram (FLASH_OBProgramInitTypeDef *pOBInit)
 Program option bytes.
void HAL_FLASHEx_OBGetConfig (FLASH_OBProgramInitTypeDef *pOBInit)
 Get the Option byte configuration.
HAL_StatusTypeDef HAL_FLASHEx_AdvOBProgram (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit)
 Program option bytes.
void HAL_FLASHEx_AdvOBGetConfig (FLASH_AdvOBProgramInitTypeDef *pAdvOBInit)
 Get the OBEX byte configuration.
HAL_StatusTypeDef HAL_FLASHEx_OB_SelectPCROP (void)
 Select the Protection Mode.
HAL_StatusTypeDef HAL_FLASHEx_OB_DeSelectPCROP (void)
 Deselect the Protection Mode.
uint16_t HAL_FLASHEx_OB_GetBank2WRP (void)
 Returns the FLASH Write Protection Option Bytes value for Bank 2.
void FLASH_Erase_Sector (uint32_t Sector, uint8_t VoltageRange)
 Erase the specified FLASH memory sector.
void FLASH_FlushCaches (void)
 Flush the instruction and data caches.

Variables

FLASH_ProcessTypeDef pFlash

Detailed Description

Extended FLASH HAL module driver. This file provides firmware functions to manage the following functionalities of the FLASH extension peripheral: + Extended programming operations functions.

Author:
MCD Application Team
  ==============================================================================
                   ##### Flash Extension features #####
  ==============================================================================

  [..] Comparing to other previous devices, the FLASH interface for STM32F427xx/437xx and
       STM32F429xx/439xx devices contains the following additional features

       (+) Capacity up to 2 Mbyte with dual bank architecture supporting read-while-write
           capability (RWW)
       (+) Dual bank memory organization
       (+) PCROP protection for all banks

                      ##### How to use this driver #####
  ==============================================================================
  [..] This driver provides functions to configure and program the FLASH memory
       of all STM32F427xx/437xx, STM32F429xx/439xx, STM32F469xx/479xx and STM32F446xx
       devices. It includes
      (#) FLASH Memory Erase functions:
           (++) Lock and Unlock the FLASH interface using HAL_FLASH_Unlock() and
                HAL_FLASH_Lock() functions
           (++) Erase function: Erase sector, erase all sectors
           (++) There are two modes of erase :
             (+++) Polling Mode using HAL_FLASHEx_Erase()
             (+++) Interrupt Mode using HAL_FLASHEx_Erase_IT()

      (#) Option Bytes Programming functions: Use HAL_FLASHEx_OBProgram() to :
           (++) Set/Reset the write protection
           (++) Set the Read protection Level
           (++) Set the BOR level
           (++) Program the user Option Bytes
      (#) Advanced Option Bytes Programming functions: Use HAL_FLASHEx_AdvOBProgram() to :
       (++) Extended space (bank 2) erase function
       (++) Full FLASH space (2 Mo) erase (bank 1 and bank 2)
       (++) Dual Boot activation
       (++) Write protection configuration for bank 2
       (++) PCROP protection configuration and control for both banks

  
Attention:

© Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32f4xx_hal_flash_ex.c.