HAL FLASH Overview ¶
Introducing FLASH ¶
- group FLASH_Introduction
-
The FLASH IO Hardware Abstraction Layer (HAL) provides high-level, user-friendly APIs for managing non-volatile memory (FLASH) operations on STM32 microcontrollers.
This layer offers firmware functions to handle key FLASH functionalities, including:
Initialization and de-initialization of FLASH handling.
Programming operations across different FLASH memory areas.
Management of operation completion and error interrupt requests.
Retrieval of FLASH memory topology and configuration information.
The abstraction provided by this layer ensures portability and simplifies application development across various STM32 microcontroller series.
Module and files ¶
The following diagram illustrates the FLASH module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the FLASH module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL FLASH module, specifying their locations, default values, and descriptions:
- group FLASH_Configuration_Table
-
¶
Configuration inside the FLASH driver ¶
Configuration defines
Description
Default value
Note
PRODUCT
from IDE
NA
The selected device (ex STM32C5xx).
USE_HAL_FLASH_MODULE
from hal_conf.h
1
Enables the HAL FLASH module.
USE_ASSERT_DBG_PARAM
from IDE
None
Enables assert check parameters.
USE_ASSERT_DBG_STATE
from IDE
None
Enables assert check states.
USE_HAL_CHECK_PARAM
from hal_conf.h
0
Enables run-time parameter checks.
USE_HAL_CHECK_PROCESS_STATE
from hal_conf.h
0
Enables load and store exclusive checks.
USE_HAL_FLASH_REGISTER_CALLBACKS
from hal_conf.h
0
Enables callback registration for FLASH.
USE_HAL_FLASH_CLK_ENABLE_MODEL
from hal_conf.h
HAL_CLK_ENABLE_NO
Enables the clock model for the FLASH.
USE_HAL_FLASH_GET_LAST_ERRORS
from hal_conf.h
0
Enables the error code mechanism.
USE_HAL_FLASH_USER_DATA
from hal_conf.h
0
Enables user data.
USE_HAL_FLASH_PROGRAM_BY_ADDR
from hal_conf.h
1
Enables program by address feature APIs.
USE_HAL_FLASH_ERASE_BY_ADDR
from hal_conf.h
1
Enables erase by address feature APIs.
USE_HAL_FLASH_ERASE_PAGE
from hal_conf.h
1
Enables erase by page feature APIs.
USE_HAL_FLASH_ERASE_BANK
from hal_conf.h
1
Enables erase by bank feature APIs.
USE_HAL_FLASH_MASS_ERASE
from hal_conf.h
1
Enables mass erase feature APIs.
USE_HAL_FLASH_ECC
from hal_conf.h
1
Enables ECC error handling APIs.
USE_HAL_FLASH_OB_EDATA
from hal_conf.h
0
Enables EDATA APIs. Value must be equal to EDATA_EN OB.
- group FLASH_ITF_Configuration_Table
-
Configuration inside the FLASH ITF driver ¶
Configuration defines
Description
Default value
Note
PRODUCT
from IDE
NA
The selected device (ex STM32C5xx).
USE_HAL_FLASH_MODULE
from hal_conf.h
1
Enables the HAL FLASH module.
USE_ASSERT_DBG_PARAM
from IDE
None
Enables assert check parameters.