rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
stm32f7xx_hal_flash_ex.c File Reference

Detailed Description

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

Author
MCD Application Team
Version
V1.2.0
Date
30-December-2016
  • Extended programming operations functions
==============================================================================
                 ##### Flash Extension features #####
==============================================================================
         
[..] Comparing to other previous devices, the FLASH interface for STM32F76xx/STM32F77xx 
     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       
     (+) Dual boot mode
 
                    ##### How to use this driver #####
==============================================================================
[..] This driver provides functions to configure and program the FLASH memory 
     of all STM32F7xx 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
Attention

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32f7xx_hal_flash_ex.c.

Functions

static HAL_StatusTypeDef FLASH_OB_EnableWRP (uint32_t WRPSector)
 Enable the write protection of the desired bank1 or bank2 sectors.
 
static HAL_StatusTypeDef FLASH_OB_DisableWRP (uint32_t WRPSector)
 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_BOR_LevelConfig (uint8_t Level)
 Set the BOR Level.
 
static HAL_StatusTypeDef FLASH_OB_BootAddressConfig (uint32_t BootOption, uint32_t Address)
 Configure Boot base address.
 
static uint32_t FLASH_OB_GetUser (void)
 Return the FLASH User Option Byte value.
 
static uint32_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 uint32_t FLASH_OB_GetBOR (void)
 Returns the FLASH BOR level.
 
static uint32_t FLASH_OB_GetBootAddress (uint32_t BootOption)
 Configure Boot base address.
 
static void FLASH_MassErase (uint8_t VoltageRange, uint32_t Banks)
 Full erase of FLASH memory sectors.
 
static HAL_StatusTypeDef FLASH_OB_UserConfig (uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, \ uint32_t Iwdgstdby, uint32_t NDBank, uint32_t NDBoot)
 Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.

 
static void FLASH_MassErase (uint8_t VoltageRange)
 Full erase of FLASH memory sectors.
 
static HAL_StatusTypeDef FLASH_OB_UserConfig (uint32_t Wwdg, uint32_t Iwdg, uint32_t Stop, uint32_t Stdby, uint32_t Iwdgstop, uint32_t Iwdgstdby)
 Program the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.

 
static HAL_StatusTypeDef FLASH_OB_PCROP_Config (uint32_t PCROPSector)
 Set the PCROP protection for sectors.
 
static HAL_StatusTypeDef FLASH_OB_PCROP_RDP_Config (uint32_t Pcrop_Rdp)
 Set the PCROP_RDP value.
 
static uint32_t FLASH_OB_GetPCROP (void)
 Return the FLASH PCROP Protection Option Bytes value.
 
static uint32_t FLASH_OB_GetPCROPRDP (void)
 Return the FLASH PCROP_RDP option byte value.
 
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.
 
void FLASH_Erase_Sector (uint32_t Sector, uint8_t VoltageRange)
 Erase the specified FLASH memory sector.
 

Variables

FLASH_ProcessTypeDef pFlash
 

Go to the source code of this file.