STM32H735xx HAL User Manual
Defines | Functions
stm32h7xx_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 "stm32h7xx_hal.h"

Go to the source code of this file.

Defines

#define FLASH_TIMEOUT_VALUE   50000U /* 50 s */

Functions

static void FLASH_MassErase (uint32_t VoltageRange, uint32_t Banks)
 Mass erase of FLASH memory.
static void FLASH_OB_EnableWRP (uint32_t WRPSector, uint32_t Banks)
 Enable the write protection of the desired bank1 or bank 2 sectors.
static void FLASH_OB_DisableWRP (uint32_t WRPSector, uint32_t Banks)
 Disable the write protection of the desired bank1 or bank 2 sectors.
static void FLASH_OB_GetWRP (uint32_t *WRPState, uint32_t *WRPSector, uint32_t Bank)
 Get the write protection of the given bank 1 or bank 2 sectors.
static void FLASH_OB_RDPConfig (uint32_t RDPLevel)
 Set the read protection level.
static uint32_t FLASH_OB_GetRDP (void)
 Get the read protection level.
static void FLASH_OB_PCROPConfig (uint32_t PCROPConfig, uint32_t PCROPStartAddr, uint32_t PCROPEndAddr, uint32_t Banks)
 Configure the Proprietary code readout protection of the desired addresses.
static void FLASH_OB_GetPCROP (uint32_t *PCROPConfig, uint32_t *PCROPStartAddr, uint32_t *PCROPEndAddr, uint32_t Bank)
 Get the Proprietary code readout protection configuration on a given Bank.
static void FLASH_OB_BOR_LevelConfig (uint32_t Level)
 Set the BOR Level.
static uint32_t FLASH_OB_GetBOR (void)
 Get the BOR Level.
static void FLASH_OB_UserConfig (uint32_t UserType, uint32_t UserConfig)
 Program the FLASH User Option Byte.
static uint32_t FLASH_OB_GetUser (void)
 Return the FLASH User Option Byte value.
static void FLASH_OB_BootAddConfig (uint32_t BootOption, uint32_t BootAddress0, uint32_t BootAddress1)
 Set Boot address.
static void FLASH_OB_GetBootAdd (uint32_t *BootAddress0, uint32_t *BootAddress1)
 Get Boot address.
static void FLASH_OB_SecureAreaConfig (uint32_t SecureAreaConfig, uint32_t SecureAreaStartAddr, uint32_t SecureAreaEndAddr, uint32_t Banks)
 Set secure area configuration.
static void FLASH_OB_GetSecureArea (uint32_t *SecureAreaConfig, uint32_t *SecureAreaStartAddr, uint32_t *SecureAreaEndAddr, uint32_t Bank)
 Get secure area configuration.
static void FLASH_CRC_AddSector (uint32_t Sector, uint32_t Bank)
 Add a CRC sector to the list of sectors on which the CRC will be calculated.
static void FLASH_CRC_SelectAddress (uint32_t CRCStartAddr, uint32_t CRCEndAddr, uint32_t Bank)
 Select CRC start and end memory addresses on which the CRC will be calculated.
static void FLASH_OB_SharedRAM_Config (uint32_t SharedRamConfig)
 Configure the TCM / AXI Shared RAM.
static uint32_t FLASH_OB_SharedRAM_GetConfig (void)
 Get the TCM / AXI Shared RAM configuration.
static void FLASH_OB_CPUFreq_BoostConfig (uint32_t FreqBoost)
 Configure the CPU Frequency Boost.
static uint32_t FLASH_OB_CPUFreq_GetBoost (void)
 Get the CPU Frequency Boost state.
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_Unlock_Bank1 (void)
 Unlock the FLASH Bank1 control registers access.
HAL_StatusTypeDef HAL_FLASHEx_Lock_Bank1 (void)
 Locks the FLASH Bank1 control registers access.
HAL_StatusTypeDef HAL_FLASHEx_ComputeCRC (FLASH_CRCInitTypeDef *pCRCInit, uint32_t *CRC_Result)
void FLASH_Erase_Sector (uint32_t Sector, uint32_t Banks, uint32_t VoltageRange)
 Erase the specified FLASH memory sector.

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 STM32H7xx
       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
       (+) Global readout protection (RDP)
       (+) Write protection
       (+) Secure access only protection
       (+) Bank / register swapping (when Dual-Bank)
       (+) Cyclic Redundancy Check (CRC)

                        ##### How to use this driver #####
 ==============================================================================
  [..] This driver provides functions to configure and program the FLASH memory
       of all STM32H7xx devices. It includes
      (#) FLASH Memory Erase functions:
           (++) Lock and Unlock the FLASH interface using HAL_FLASH_Unlock() and
                HAL_FLASH_Lock() functions
           (++) Erase function: Sector erase, bank erase and dual-bank mass erase
           (++) 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 per bank
        (++) Set the Read protection Level
        (++) Set the BOR level
        (++) Program the user Option Bytes
        (++) PCROP protection configuration and control per bank
        (++) Secure area configuration and control per bank
        (++) Core Boot address configuration
        (++) TCM / AXI shared RAM configuration
        (++) CPU Frequency Boost configuration

      (#) FLASH Memory Lock and unlock per Bank: HAL_FLASHEx_Lock_Bank1(), HAL_FLASHEx_Unlock_Bank1(),
          HAL_FLASHEx_Lock_Bank2() and HAL_FLASHEx_Unlock_Bank2() functions

      (#) FLASH CRC computation function: Use HAL_FLASHEx_ComputeCRC() to:
          (++) Enable CRC feature
          (++) Program the desired burst size
          (++) Define the user Flash Area on which the CRC has be computed
          (++) Perform the CRC computation
          (++) Disable CRC feature

 
Attention:

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32h7xx_hal_flash_ex.c.