HAL FLASH Functions ¶
HAL FLASH Initialization and De-initialization functions ¶
- group FLASH_Exported_Functions_Group1
-
This subsection provides a set of functions to initialize and de-initialize the Flash peripheral:
-
Call HAL_FLASH_Init() to initialize the Flash handle and associate a physical instance. (Optionally, the Flash clock is enabled inside the function)
-
Call HAL_FLASH_DeInit() to de-initialize the Flash instance, When called, the API wait for end of ongoing process and put the Flash state machine in idle state.
Functions
-
hal_status_t
HAL_FLASH_Init
(
hal_flash_handle_t
*
hflash
,
hal_flash_t
instance
)
¶
-
Initialize the Flash handle and associate a physical Flash instance.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
instance – Specifies the Flash instance based on hal_flash_t enumeration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hflash pointer is NULL.
-
HAL_OK – Flash is successfully initialized.
-
-
void
HAL_FLASH_DeInit
(
hal_flash_handle_t
*
hflash
)
¶
-
De-initialize the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
- group FLASH_Exported_Functions_Group1
-
This subsection provides a set of functions to initialize and de-initialize the Flash peripheral:
-
Call HAL_FLASH_Init() to initialize the Flash handle and associate a physical instance. (Optionally, the Flash clock is enabled inside the function)
-
Call HAL_FLASH_DeInit() to de-initialize the Flash instance, When called, the API wait for end of ongoing process and put the Flash state machine in idle state.
Functions
-
hal_status_t
HAL_FLASH_Init
(
hal_flash_handle_t
*
hflash
,
hal_flash_t
instance
)
-
Initialize the Flash handle and associate a physical Flash instance.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
instance – Specifies the Flash instance based on hal_flash_t enumeration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hflash pointer is NULL.
-
HAL_OK – Flash is successfully initialized.
-
-
void
HAL_FLASH_DeInit
(
hal_flash_handle_t
*
hflash
)
-
De-initialize the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
- group FLASH_Exported_Functions_Group1
-
This subsection provides a set of functions to initialize and de-initialize the Flash peripheral:
-
Call HAL_FLASH_Init() to initialize the Flash handle and associate a physical instance. (Optionally, the Flash clock is enabled inside the function)
-
Call HAL_FLASH_DeInit() to de-initialize the Flash instance, When called, the API wait for end of ongoing process and put the Flash state machine in idle state.
Functions
-
hal_status_t
HAL_FLASH_Init
(
hal_flash_handle_t
*
hflash
,
hal_flash_t
instance
)
-
Initialize the Flash handle and associate a physical Flash instance.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
instance – Specifies the Flash instance based on hal_flash_t enumeration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter when hflash pointer is NULL.
-
HAL_OK – Flash is successfully initialized.
-
-
void
HAL_FLASH_DeInit
(
hal_flash_handle_t
*
hflash
)
-
De-initialize the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
HAL FLASH Configuration functions ¶
- group FLASH_Exported_Functions_Group2
-
This subsection provides a set of functions to configure the Flash programming mode:
-
Call the function HAL_FLASH_SetProgrammingMode() to set the programming mode. (After reset the Quad-word programming is selected).
-
Call the function HAL_FLASH_GetProgrammingMode() to get the programming mode.
Functions
-
hal_status_t
HAL_FLASH_SetProgrammingMode
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_mode_t
programming_mode
)
¶
-
Set the Flash programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
programming_mode – This parameter is one element of hal_flash_program_mode_t enumeration.
-
- Return values :
-
HAL_OK – Programming mode is successfully configured.
-
hal_flash_program_mode_t
HAL_FLASH_GetProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the Flash programming mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_program_mode_t – Programming mode.
-
- group FLASH_Exported_Functions_Group2
-
This subsection provides a set of functions to configure the Flash programming mode:
-
Call the function HAL_FLASH_SetProgrammingMode() to set the programming mode. (After reset the Quad-word programming is selected).
-
Call the function HAL_FLASH_GetProgrammingMode() to get the programming mode.
Functions
-
hal_status_t
HAL_FLASH_SetProgrammingMode
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_mode_t
programming_mode
)
-
Set the Flash programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
programming_mode – This parameter is one element of hal_flash_program_mode_t enumeration.
-
- Return values :
-
HAL_OK – Programming mode is successfully configured.
-
hal_flash_program_mode_t
HAL_FLASH_GetProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
-
Get the Flash programming mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_program_mode_t – Programming mode.
-
- group FLASH_Exported_Functions_Group2
-
This subsection provides a set of functions to configure the Flash programming mode:
-
Call the function HAL_FLASH_SetProgrammingMode() to set the programming mode. (After reset the Quad-word programming is selected).
-
Call the function HAL_FLASH_GetProgrammingMode() to get the programming mode.
Functions
-
hal_status_t
HAL_FLASH_SetProgrammingMode
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_mode_t
programming_mode
)
-
Set the Flash programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
programming_mode – This parameter is one element of hal_flash_program_mode_t enumeration.
-
- Return values :
-
HAL_OK – Programming mode is successfully configured.
-
hal_flash_program_mode_t
HAL_FLASH_GetProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
-
Get the Flash programming mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_program_mode_t – Programming mode.
-
HAL FLASH Process Operations functions ¶
- group FLASH_Exported_Functions_Group3
-
This subsection provides a set of functions to program and erase any Flash main user memory area:
-
Call HAL_FLASH_ProgramByAddr() to program any Flash memory user area in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt() to program any Flash memory user area in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_ProgramByAddr_IT() to program any Flash memory user area in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt_IT() to program any Flash memory user area in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr() to program any Flash memory OTP area in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_EraseByAddr() to erase by address any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseByAddr_IT() to erase by address any Flash memory area in interrupt mode.
-
Call HAL_FLASH_ErasePage() to erase by page any Flash memory area in polling mode.
-
Call HAL_FLASH_ErasePage_IT() to erase by page any Flash memory area in interrupt mode.
-
Call HAL_FLASH_EraseBank() to erase by bank any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseBank_IT() to erase by bank any Flash memory area in interrupt mode.
-
Call HAL_FLASH_MassErase() to mass erase the entire Flash memory area in polling mode.
-
Call HAL_FLASH_MassErase_IT() to mass erase the entire Flash memory area in interrupt mode.
-
Call HAL_FLASH_IRQHandler() to handle any Flash interrupt.
-
Call HAL_FLASH_ProgramByAddr_IRQHandler() to handle any Flash program by address interrupt.
-
Call HAL_FLASH_EraseByAddr_IRQHandler() to handle any Flash erase by address interrupt.
-
Call HAL_FLASH_ErasePage_IRQHandler() to handle any Flash page erase interrupt.
-
Call HAL_FLASH_EraseBank_IRQHandler() to handle any Flash bank erase interrupt.
-
Call HAL_FLASH_MassErase_IRQHandler() to handle any Flash mass erase interrupt.
-
Call HAL_FLASH_ECC_IRQHandler() to handle any Flash ECC single error detection correction interrupt.
-
Call HAL_FLASH_NMI_IRQHandler() to handle any Flash NMI interrupt.
-
Call HAL_FLASH_NS_ProgramByAddr() to program any NSecure Flash memory User area from Secure context in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt() to program any NSecure Flash memory User area from Secure context in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_ProgramByAddr_IT() to program any NSecure Flash memory User area from Secure context in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt_IT() to program any Flash memory User area from Secure context in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr_IT() to program any Flash memory OTP area from Secure context in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT() to program any NSecure Flash memory OTP area from secure context in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_EraseByAddr() to erase by address any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseByAddr_IT() to erase by address any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_ErasePage() to erase by page any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_ErasePage_IT() to erase by page any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_EraseBank() to erase by bank any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseBank_IT() to erase by bank any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_MassErase() to mass erase the entire NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_MassErase_IT() to mass erase the entire NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_IRQHandler() to handle any NSecure Flash interrupt from Secure context.
-
Call HAL_FLASH_NS_ProgramByAddr_IRQHandler() to handle any NSecure Flash program by address interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseByAddr_IRQHandler() to handle any NSecure Flash erase by address interrupt from Secure context.
-
Call HAL_FLASH_NS_ErasePage_IRQHandler() to handle any NSecure Flash page erase interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseBank_IRQHandler() to handle any NSecure Flash bank erase interrupt from Secure context.
-
Call HAL_FLASH_NS_MassErase_IRQHandler() to handle any NSecure Flash mass erase interrupt from Secure context.
Functions
-
hal_status_t
HAL_FLASH_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program any Flash memory User area in polling mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program any Flash memory User area in polling mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program any Flash memory User area in interrupt mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program any Flash memory User area in interrupt mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Erase any Flash memory User area in polling mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
¶
-
Erase any Flash memory User area in interrupt mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
¶
-
Erase by page any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
¶
-
Erase by page any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
¶
-
Erase by bank any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Erase by bank any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Mass erase the entire Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
¶
-
Mass erase the entire Flash memory User area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ECC_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash ECC single error detection correction interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_NMI_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash NMI interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
cb_status – Return of ECC error callback status
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program the NSecure Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program the NSecure Flash memory area at a specified address using adaptive width in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program the NSecure Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program the NSecure Flash memory area at a specified address using adaptive width in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program the OTP area at a specified address in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program the OTP area at a specified address using adaptive width in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program the OTP area at a specified address in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program the OTP area at a specified address using adaptive width in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Erase the Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
¶
-
Erase the Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
¶
-
Erase by page the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page(s) erase operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
¶
-
Erase by page the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of pages to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
¶
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter selected.
-
HAL_ERROR – Returned when the control registers access locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Mass erase the entire NSecure Flash memory in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
¶
-
Mass erase the entire NSecure Flash memory in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_NS_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash standard and adaptive program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the NSecure Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
- group FLASH_Exported_Functions_Group3
-
This subsection provides a set of functions to program and erase any Flash main user memory area:
-
Call HAL_FLASH_ProgramByAddr() to program any Flash memory user area in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt() to program any Flash memory user area in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_ProgramByAddr_IT() to program any Flash memory user area in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt_IT() to program any Flash memory user area in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr() to program any Flash memory OTP area in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_EraseByAddr() to erase by address any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseByAddr_IT() to erase by address any Flash memory area in interrupt mode.
-
Call HAL_FLASH_ErasePage() to erase by page any Flash memory area in polling mode.
-
Call HAL_FLASH_ErasePage_IT() to erase by page any Flash memory area in interrupt mode.
-
Call HAL_FLASH_EraseBank() to erase by bank any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseBank_IT() to erase by bank any Flash memory area in interrupt mode.
-
Call HAL_FLASH_MassErase() to mass erase the entire Flash memory area in polling mode.
-
Call HAL_FLASH_MassErase_IT() to mass erase the entire Flash memory area in interrupt mode.
-
Call HAL_FLASH_IRQHandler() to handle any Flash interrupt.
-
Call HAL_FLASH_ProgramByAddr_IRQHandler() to handle any Flash program by address interrupt.
-
Call HAL_FLASH_EraseByAddr_IRQHandler() to handle any Flash erase by address interrupt.
-
Call HAL_FLASH_ErasePage_IRQHandler() to handle any Flash page erase interrupt.
-
Call HAL_FLASH_EraseBank_IRQHandler() to handle any Flash bank erase interrupt.
-
Call HAL_FLASH_MassErase_IRQHandler() to handle any Flash mass erase interrupt.
-
Call HAL_FLASH_ECC_IRQHandler() to handle any Flash ECC single error detection correction interrupt.
-
Call HAL_FLASH_NMI_IRQHandler() to handle any Flash NMI interrupt.
-
Call HAL_FLASH_NS_ProgramByAddr() to program any NSecure Flash memory User area from Secure context in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt() to program any NSecure Flash memory User area from Secure context in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_ProgramByAddr_IT() to program any NSecure Flash memory User area from Secure context in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt_IT() to program any Flash memory User area from Secure context in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr_IT() to program any Flash memory OTP area from Secure context in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT() to program any NSecure Flash memory OTP area from secure context in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_EraseByAddr() to erase by address any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseByAddr_IT() to erase by address any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_ErasePage() to erase by page any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_ErasePage_IT() to erase by page any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_EraseBank() to erase by bank any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseBank_IT() to erase by bank any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_MassErase() to mass erase the entire NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_MassErase_IT() to mass erase the entire NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_IRQHandler() to handle any NSecure Flash interrupt from Secure context.
-
Call HAL_FLASH_NS_ProgramByAddr_IRQHandler() to handle any NSecure Flash program by address interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseByAddr_IRQHandler() to handle any NSecure Flash erase by address interrupt from Secure context.
-
Call HAL_FLASH_NS_ErasePage_IRQHandler() to handle any NSecure Flash page erase interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseBank_IRQHandler() to handle any NSecure Flash bank erase interrupt from Secure context.
-
Call HAL_FLASH_NS_MassErase_IRQHandler() to handle any NSecure Flash mass erase interrupt from Secure context.
Functions
-
hal_status_t
HAL_FLASH_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program any Flash memory User area in polling mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program any Flash memory User area in polling mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program any Flash memory User area in interrupt mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program any Flash memory User area in interrupt mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Erase any Flash memory User area in polling mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Erase any Flash memory User area in interrupt mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
-
Erase by page any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Erase by page any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
-
Erase by bank any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Erase by bank any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Mass erase the entire Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
-
Mass erase the entire Flash memory User area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ECC_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash ECC single error detection correction interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_NMI_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash NMI interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
cb_status – Return of ECC error callback status
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the NSecure Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the NSecure Flash memory area at a specified address using adaptive width in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the NSecure Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the NSecure Flash memory area at a specified address using adaptive width in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the OTP area at a specified address in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the OTP area at a specified address using adaptive width in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the OTP area at a specified address in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the OTP area at a specified address using adaptive width in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Erase the Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Erase the Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
-
Erase by page the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page(s) erase operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Erase by page the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of pages to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter selected.
-
HAL_ERROR – Returned when the control registers access locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Mass erase the entire NSecure Flash memory in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
-
Mass erase the entire NSecure Flash memory in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_NS_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash standard and adaptive program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
- group FLASH_Exported_Functions_Group3
-
This subsection provides a set of functions to program and erase any Flash main user memory area:
-
Call HAL_FLASH_ProgramByAddr() to program any Flash memory user area in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt() to program any Flash memory user area in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_ProgramByAddr_IT() to program any Flash memory user area in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_ProgramByAddrAdapt_IT() to program any Flash memory user area in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr() to program any Flash memory OTP area in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddr_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_OTP_ProgramByAddrAdapt_IT() to program any Flash memory OTP area in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_EraseByAddr() to erase by address any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseByAddr_IT() to erase by address any Flash memory area in interrupt mode.
-
Call HAL_FLASH_ErasePage() to erase by page any Flash memory area in polling mode.
-
Call HAL_FLASH_ErasePage_IT() to erase by page any Flash memory area in interrupt mode.
-
Call HAL_FLASH_EraseBank() to erase by bank any Flash memory area in polling mode.
-
Call HAL_FLASH_EraseBank_IT() to erase by bank any Flash memory area in interrupt mode.
-
Call HAL_FLASH_MassErase() to mass erase the entire Flash memory area in polling mode.
-
Call HAL_FLASH_MassErase_IT() to mass erase the entire Flash memory area in interrupt mode.
-
Call HAL_FLASH_IRQHandler() to handle any Flash interrupt.
-
Call HAL_FLASH_ProgramByAddr_IRQHandler() to handle any Flash program by address interrupt.
-
Call HAL_FLASH_EraseByAddr_IRQHandler() to handle any Flash erase by address interrupt.
-
Call HAL_FLASH_ErasePage_IRQHandler() to handle any Flash page erase interrupt.
-
Call HAL_FLASH_EraseBank_IRQHandler() to handle any Flash bank erase interrupt.
-
Call HAL_FLASH_MassErase_IRQHandler() to handle any Flash mass erase interrupt.
-
Call HAL_FLASH_ECC_IRQHandler() to handle any Flash ECC single error detection correction interrupt.
-
Call HAL_FLASH_NMI_IRQHandler() to handle any Flash NMI interrupt.
-
Call HAL_FLASH_NS_ProgramByAddr() to program any NSecure Flash memory User area from Secure context in polling mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt() to program any NSecure Flash memory User area from Secure context in polling mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_ProgramByAddr_IT() to program any NSecure Flash memory User area from Secure context in interrupt mode using flash address according to selected programming mode.
-
Call HAL_FLASH_NS_ProgramByAddrAdapt_IT() to program any Flash memory User area from Secure context in interrupt mode using flash address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt() to program any Flash memory OTP area from Secure context in polling mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddr_IT() to program any Flash memory OTP area from Secure context in interrupt mode using flash OTP address according to selected programming mode.
-
Call HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT() to program any NSecure Flash memory OTP area from secure context in interrupt mode using flash OTP address with adaptive programming mode.
-
Call HAL_FLASH_NS_EraseByAddr() to erase by address any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseByAddr_IT() to erase by address any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_ErasePage() to erase by page any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_ErasePage_IT() to erase by page any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_EraseBank() to erase by bank any NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_EraseBank_IT() to erase by bank any NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_MassErase() to mass erase the entire NSecure Flash memory area from Secure context in polling mode.
-
Call HAL_FLASH_NS_MassErase_IT() to mass erase the entire NSecure Flash memory area from Secure context in interrupt mode.
-
Call HAL_FLASH_NS_IRQHandler() to handle any NSecure Flash interrupt from Secure context.
-
Call HAL_FLASH_NS_ProgramByAddr_IRQHandler() to handle any NSecure Flash program by address interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseByAddr_IRQHandler() to handle any NSecure Flash erase by address interrupt from Secure context.
-
Call HAL_FLASH_NS_ErasePage_IRQHandler() to handle any NSecure Flash page erase interrupt from Secure context.
-
Call HAL_FLASH_NS_EraseBank_IRQHandler() to handle any NSecure Flash bank erase interrupt from Secure context.
-
Call HAL_FLASH_NS_MassErase_IRQHandler() to handle any NSecure Flash mass erase interrupt from Secure context.
Functions
-
hal_status_t
HAL_FLASH_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program any Flash memory User area in polling mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program any Flash memory User area in polling mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program any Flash memory User area in interrupt mode using flash address according to selected programming mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program any Flash memory User area in interrupt mode using flash address with adaptive programming mode. The adaptive mode allows to optimize Flash programming access versus remaining data size with ignoring Flash programming mode selected by HAL_FLASH_SetProgrammingMode() API.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Erase any Flash memory User area in polling mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Erase any Flash memory User area in interrupt mode using flash address.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
-
Erase by page any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Erase by page any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
-
Erase by bank any Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Erase by bank any Flash memory User area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Mass erase the entire Flash memory User area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
-
Mass erase the entire Flash memory User area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ECC_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash ECC single error detection correction interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_NMI_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash NMI interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
cb_status – Return of ECC error callback status
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the NSecure Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the NSecure Flash memory area at a specified address using adaptive width in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the NSecure Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the NSecure Flash memory area at a specified address using adaptive width in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the NSecure programming operation.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the OTP area at a specified address in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program the OTP area at a specified address using adaptive width in polling mode.
Warning
This API must be used only through NSecure world when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for the programming operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_TIMEOUT – Returned when internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the OTP area at a specified address in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_OTP_ProgramByAddrAdapt_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
otp_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program the OTP area at a specified address using adaptive width in interrupt mode.
Warning
This API must be used only through NSecure access when TrustZone is enabled.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
otp_addr – OTP address.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked or when TrustZone is disabled.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Erase the Flash memory area at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
timeout_msec – Timeout value for the erasing by address operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseByAddr_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Erase the Flash memory area at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of the erase operation.
-
size_byte – Size of the data to be erased (in bytes).
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
,
uint32_t
timeout_msec
)
-
Erase by page the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of page(s) to be erased.
-
timeout_msec – Timeout value for the page(s) erase operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_ErasePage_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Erase by page the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – First page to be erased.
-
page_nbr – Number of pages to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
timeout_msec
)
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
timeout_msec – Timeout value for the bank erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Bank to be erased.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter selected.
-
HAL_ERROR – Returned when the control registers access locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Mass erase the entire NSecure Flash memory in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for the mass erasing operation.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
hal_status_t
HAL_FLASH_NS_MassErase_IT
(
hal_flash_handle_t
*
hflash
)
-
Mass erase the entire NSecure Flash memory in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the erasing operation is completed successfully.
-
-
void
HAL_FLASH_NS_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash interrupt requests.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ProgramByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash standard and adaptive program by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseByAddr_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by address interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_ErasePage_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by page interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_EraseBank_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash erase by bank interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_NS_MassErase_IRQHandler
(
hal_flash_handle_t
*
hflash
)
-
Handle the NSecure Flash mass erase interrupt request.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
HAL FLASH Callback functions ¶
- group FLASH_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to register the Flash callbacks:
-
Call HAL_FLASH_ProgramCpltCallback() to be redefined within user application for the program complete callback.
-
Call HAL_FLASH_EraseByAddrCpltCallback() to be redefined within user application for the erase by address complete callback.
-
Call HAL_FLASH_ErasePageCpltCallback() to be redefined within user application for the erase by page complete callback.
-
Call HAL_FLASH_EraseBankCpltCallback() to be redefined within user application for the bank erase complete callback.
-
Call HAL_FLASH_MassEraseCpltCallback() to be redefined within user application for the mass erase complete callback.
-
Call HAL_FLASH_ErrorCallback() to be redefined within user application for the error callback.
-
Call HAL_FLASH_ECC_ErrorCallback() to be redefined within user application for the ECC error callback.
-
Call HAL_FLASH_RegisterProgramCpltCallback() to register the Flash program by address complete callback.
-
Call HAL_FLASH_RegisterEraseByAddrCpltCallback() to register the Flash erase by address complete callback.
-
Call HAL_FLASH_RegisterErasePageCpltCallback() to register the Flash erase by page complete callback.
-
Call HAL_FLASH_RegisterEraseBankCpltCallback() to register the Flash erase by bank complete callback.
-
Call HAL_FLASH_RegisterMassEraseCpltCallback() to register the Flash mass erase complete callback.
-
Call HAL_FLASH_RegisterErrorCallback() to register the Flash error callback.
-
Call HAL_FLASH_RegisterECCErrorCallback() to register the Flash ECC error callback.
Functions
-
void
HAL_FLASH_ProgramCpltCallback
(
hal_flash_handle_t
*
hflash
)
¶
-
Flash program by address complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
¶
-
Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Erased address.
-
size_byte – Erased size in byte.
-
-
void
HAL_FLASH_ErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
¶
-
Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – Index of the erased page(s).
-
page_nbr – Number of the erased page(s).
-
-
void
HAL_FLASH_EraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Pointer to a hal_flash_bank_t structure.
-
-
void
HAL_FLASH_MassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
)
¶
-
Flash mass erase complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
¶
-
Flash error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_ECC_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
¶
-
Flash ECC error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
HAL_ERROR – Returned when an ECC error occurred.
-
hal_status_t
HAL_FLASH_RegisterProgramCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_cplt_cb_t
callback
)
¶
-
Register the Flash program by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the program complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_by_addr_cplt_cb_t
callback
)
¶
-
Register the Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by address complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_page_cplt_cb_t
callback
)
¶
-
Register the Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by page complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_bank_cplt_cb_t
callback
)
¶
-
Register the Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the bank erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterMassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_mass_erase_cplt_cb_t
callback
)
¶
-
Register the Flash mass erase complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the mass erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_error_cb_t
callback
)
¶
-
Register the Flash error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterECCErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_error_cb_t
callback
)
¶
-
Register the Flash ECC error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the ECC error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
- group FLASH_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to register the Flash callbacks:
-
Call HAL_FLASH_ProgramCpltCallback() to be redefined within user application for the program complete callback.
-
Call HAL_FLASH_EraseByAddrCpltCallback() to be redefined within user application for the erase by address complete callback.
-
Call HAL_FLASH_ErasePageCpltCallback() to be redefined within user application for the erase by page complete callback.
-
Call HAL_FLASH_EraseBankCpltCallback() to be redefined within user application for the bank erase complete callback.
-
Call HAL_FLASH_MassEraseCpltCallback() to be redefined within user application for the mass erase complete callback.
-
Call HAL_FLASH_ErrorCallback() to be redefined within user application for the error callback.
-
Call HAL_FLASH_ECC_ErrorCallback() to be redefined within user application for the ECC error callback.
-
Call HAL_FLASH_RegisterProgramCpltCallback() to register the Flash program by address complete callback.
-
Call HAL_FLASH_RegisterEraseByAddrCpltCallback() to register the Flash erase by address complete callback.
-
Call HAL_FLASH_RegisterErasePageCpltCallback() to register the Flash erase by page complete callback.
-
Call HAL_FLASH_RegisterEraseBankCpltCallback() to register the Flash erase by bank complete callback.
-
Call HAL_FLASH_RegisterMassEraseCpltCallback() to register the Flash mass erase complete callback.
-
Call HAL_FLASH_RegisterErrorCallback() to register the Flash error callback.
-
Call HAL_FLASH_RegisterECCErrorCallback() to register the Flash ECC error callback.
Functions
-
void
HAL_FLASH_ProgramCpltCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash program by address complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Erased address.
-
size_byte – Erased size in byte.
-
-
void
HAL_FLASH_ErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – Index of the erased page(s).
-
page_nbr – Number of the erased page(s).
-
-
void
HAL_FLASH_EraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Pointer to a hal_flash_bank_t structure.
-
-
void
HAL_FLASH_MassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash mass erase complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_ECC_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash ECC error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
HAL_ERROR – Returned when an ECC error occurred.
-
hal_status_t
HAL_FLASH_RegisterProgramCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_cplt_cb_t
callback
)
-
Register the Flash program by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the program complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_by_addr_cplt_cb_t
callback
)
-
Register the Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by address complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_page_cplt_cb_t
callback
)
-
Register the Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by page complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_bank_cplt_cb_t
callback
)
-
Register the Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the bank erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterMassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_mass_erase_cplt_cb_t
callback
)
-
Register the Flash mass erase complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the mass erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_error_cb_t
callback
)
-
Register the Flash error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterECCErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_error_cb_t
callback
)
-
Register the Flash ECC error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the ECC error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
- group FLASH_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to register the Flash callbacks:
-
Call HAL_FLASH_ProgramCpltCallback() to be redefined within user application for the program complete callback.
-
Call HAL_FLASH_EraseByAddrCpltCallback() to be redefined within user application for the erase by address complete callback.
-
Call HAL_FLASH_ErasePageCpltCallback() to be redefined within user application for the erase by page complete callback.
-
Call HAL_FLASH_EraseBankCpltCallback() to be redefined within user application for the bank erase complete callback.
-
Call HAL_FLASH_MassEraseCpltCallback() to be redefined within user application for the mass erase complete callback.
-
Call HAL_FLASH_ErrorCallback() to be redefined within user application for the error callback.
-
Call HAL_FLASH_ECC_ErrorCallback() to be redefined within user application for the ECC error callback.
-
Call HAL_FLASH_RegisterProgramCpltCallback() to register the Flash program by address complete callback.
-
Call HAL_FLASH_RegisterEraseByAddrCpltCallback() to register the Flash erase by address complete callback.
-
Call HAL_FLASH_RegisterErasePageCpltCallback() to register the Flash erase by page complete callback.
-
Call HAL_FLASH_RegisterEraseBankCpltCallback() to register the Flash erase by bank complete callback.
-
Call HAL_FLASH_RegisterMassEraseCpltCallback() to register the Flash mass erase complete callback.
-
Call HAL_FLASH_RegisterErrorCallback() to register the Flash error callback.
-
Call HAL_FLASH_RegisterECCErrorCallback() to register the Flash ECC error callback.
Functions
-
void
HAL_FLASH_ProgramCpltCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash program by address complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_EraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
uint32_t
size_byte
)
-
Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Erased address.
-
size_byte – Erased size in byte.
-
-
void
HAL_FLASH_ErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
,
uint32_t
page_nbr
)
-
Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – This parameter is one element of hal_flash_bank_t enumeration.
-
page – Index of the erased page(s).
-
page_nbr – Number of the erased page(s).
-
-
void
HAL_FLASH_EraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Pointer to a hal_flash_bank_t structure.
-
-
void
HAL_FLASH_MassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash mass erase complete callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
HAL_FLASH_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
HAL_FLASH_ECC_ErrorCallback
(
hal_flash_handle_t
*
hflash
)
-
Flash ECC error callback.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
HAL_ERROR – Returned when an ECC error occurred.
-
hal_status_t
HAL_FLASH_RegisterProgramCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_program_cplt_cb_t
callback
)
-
Register the Flash program by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the program complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseByAddrCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_by_addr_cplt_cb_t
callback
)
-
Register the Flash erase by address complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by address complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterErasePageCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_page_cplt_cb_t
callback
)
-
Register the Flash erase by page complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the erase by page complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is selected.
-
HAL_OK – Returned when the registration of the callback is completed successfully.
-
-
hal_status_t
HAL_FLASH_RegisterEraseBankCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_erase_bank_cplt_cb_t
callback
)
-
Register the Flash erase by bank complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the bank erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterMassEraseCpltCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_mass_erase_cplt_cb_t
callback
)
-
Register the Flash mass erase complete callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the mass erase complete callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_error_cb_t
callback
)
-
Register the Flash error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
hal_status_t
HAL_FLASH_RegisterECCErrorCallback
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_error_cb_t
callback
)
-
Register the Flash ECC error callback.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
callback – Specifies the ECC error callback.
-
- Return values :
-
-
HAL_INVALID_PARAM – Returned when an invalid input parameter is provided.
-
HAL_OK – Returned when the registration of the callback is successful.
-
-
HAL FLASH Status functions ¶
- group FLASH_Exported_Functions_Group5
-
This subsection provides functions to get Flash general data information and status:
-
Call HAL_FLASH_GetOperation() to get the last Flash ongoing operation.
-
Call HAL_FLASH_GetProgramOperationInfo() to get the last program operation info.
-
Call HAL_FLASH_GetEraseByAddrOperationInfo() to get the last erase by address operation info.
-
Call HAL_FLASH_GetErasePageOperationInfo() to get the last erase by page operation info.
-
Call HAL_FLASH_GetEraseBankOperationInfo() to get the last bank erase operation info.
-
Call HAL_FLASH_GetInterruptedByResetOperationInfo() to get the Flash interrupted operation info.
-
Call HAL_FLASH_GetInfo() to get the Flash memory organization information.
-
Call HAL_FLASH_ECC_GetFailInfo() to get the Flash ECC error information.
-
Call HAL_FLASH_GetSizeByte() to get the total Flash size in bytes.
-
Call HAL_FLASH_GetBankNbr() to get the total Flash number of banks.
-
Call HAL_FLASH_GetBankSizeByte() to get the total Flash size per bank.
-
Call HAL_FLASH_GetUserFlashSizeByte() to get the User Flash size in bytes of any given bank.
-
Call HAL_FLASH_GetUserFlashPageNbr() to get the User Flash number of pages per bank.
-
Call HAL_FLASH_GetUserFlashPageSizeByte() to get the User Flash size of any given page.
-
Call HAL_FLASH_GetUserFlashAddrOffset() to get the User Flash offset address of any given page.
-
Call HAL_FLASH_GetState() to get the Flash current state.
-
Call HAL_FLASH_GetLastErrorCodes() to get the Flash last error codes.
-
Call HAL_FLASH_SetUserData() to set user data in the Flash handle.
-
Call HAL_FLASH_GetUserData() to set user data from the Flash handle.
Functions
-
hal_flash_operation_t
HAL_FLASH_GetOperation
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the last Flash operation.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_operation_t – The last operation performed.
-
void
HAL_FLASH_GetProgramOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
prog_flash_addr
,
uint32_t
*
prog_data_addr
,
uint32_t
*
programmed_data_byte
)
¶
-
Get the last programming operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
prog_data_addr – Address of the data to be programmed.
-
prog_flash_addr – Address in the Flash where the data is programmed
-
programmed_data_byte – Size in bytes of the programmed data.
-
-
void
HAL_FLASH_GetEraseByAddrOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
flash_addr
,
uint32_t
*
erased_size_byte
)
¶
-
Get the last address erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address of the first page erased.
-
erased_size_byte – Size in bytes of the erased page.
-
-
void
HAL_FLASH_GetErasePageOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
*
bank
,
uint32_t
*
page
,
uint32_t
*
erased_page_nbr
)
¶
-
Get the last page erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Erased bank.
-
page – Index of the first page erased.
-
erased_page_nbr – Number of page(s) erased.
-
-
hal_flash_bank_t
HAL_FLASH_GetEraseBankOperationInfo
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the last bank erase operation information.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_bank_t – Index of the erased bank.
-
void
HAL_FLASH_GetInterruptedByResetOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_interrupted_by_reset_operation_info_t
*
p_info
)
¶
-
Get the interrupted Flash operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_interrupted_by_reset_operation_info_t structure.
-
-
void
HAL_FLASH_GetInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_info_t
*
p_info
)
¶
-
Get the Flash general information (size, number and size of banks, number and size of pages).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_info_t structure.
-
-
void
HAL_FLASH_ECC_GetFailInfo
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_fail_info_t
*
p_info
)
¶
-
Get the Flash ECC fail information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_ecc_fail_info_t structure.
-
-
uint32_t
HAL_FLASH_GetSizeByte
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the total Flash size (in bytes).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash size (in bytes).
-
uint8_t
HAL_FLASH_GetBankNbr
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the total Flash number of banks.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash number of banks.
-
uint32_t
HAL_FLASH_GetBankSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Get the total Flash size per bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – Total Flash size per bank (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Get the User Flash size of the specified bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash size of the specified bank (in bytes).
-
uint16_t
HAL_FLASH_GetUserFlashPageNbr
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
¶
-
Get the User Flash number of pages per bank.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash number of pages per bank.
-
uint32_t
HAL_FLASH_GetUserFlashPageSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
¶
-
Get the User Flash size of the specified page (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page.
-
- Return values :
-
uint32_t – User Flash size of the specified page (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashAddrOffset
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
¶
-
Get the User Flash offset address of the specified page.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page within the specified bank.
-
- Return values :
-
uint32_t – Offset address of the specified page.
-
hal_flash_state_t
HAL_FLASH_GetState
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the current Flash global state.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_state_t – Current global state of the Flash.
-
uint32_t
HAL_FLASH_GetLastErrorCodes
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Get the current Flash last error codes.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Flash last error codes.
-
void
HAL_FLASH_SetUserData
(
hal_flash_handle_t
*
hflash
,
const
void
*
p_user_data
)
¶
-
Store the User data pointer within the Flash handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FLASH_GetUserData
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Retrieve the User data pointer from the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
void* – Pointer to the user data.
-
- group FLASH_Exported_Functions_Group5
-
This subsection provides functions to get Flash general data information and status:
-
Call HAL_FLASH_GetOperation() to get the last Flash ongoing operation.
-
Call HAL_FLASH_GetProgramOperationInfo() to get the last program operation info.
-
Call HAL_FLASH_GetEraseByAddrOperationInfo() to get the last erase by address operation info.
-
Call HAL_FLASH_GetErasePageOperationInfo() to get the last erase by page operation info.
-
Call HAL_FLASH_GetEraseBankOperationInfo() to get the last bank erase operation info.
-
Call HAL_FLASH_GetInterruptedByResetOperationInfo() to get the Flash interrupted operation info.
-
Call HAL_FLASH_GetInfo() to get the Flash memory organization information.
-
Call HAL_FLASH_ECC_GetFailInfo() to get the Flash ECC error information.
-
Call HAL_FLASH_GetSizeByte() to get the total Flash size in bytes.
-
Call HAL_FLASH_GetBankNbr() to get the total Flash number of banks.
-
Call HAL_FLASH_GetBankSizeByte() to get the total Flash size per bank.
-
Call HAL_FLASH_GetUserFlashSizeByte() to get the User Flash size in bytes of any given bank.
-
Call HAL_FLASH_GetUserFlashPageNbr() to get the User Flash number of pages per bank.
-
Call HAL_FLASH_GetUserFlashPageSizeByte() to get the User Flash size of any given page.
-
Call HAL_FLASH_GetUserFlashAddrOffset() to get the User Flash offset address of any given page.
-
Call HAL_FLASH_GetState() to get the Flash current state.
-
Call HAL_FLASH_GetLastErrorCodes() to get the Flash last error codes.
-
Call HAL_FLASH_SetUserData() to set user data in the Flash handle.
-
Call HAL_FLASH_GetUserData() to set user data from the Flash handle.
Functions
-
hal_flash_operation_t
HAL_FLASH_GetOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Get the last Flash operation.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_operation_t – The last operation performed.
-
void
HAL_FLASH_GetProgramOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
prog_flash_addr
,
uint32_t
*
prog_data_addr
,
uint32_t
*
programmed_data_byte
)
-
Get the last programming operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
prog_data_addr – Address of the data to be programmed.
-
prog_flash_addr – Address in the Flash where the data is programmed
-
programmed_data_byte – Size in bytes of the programmed data.
-
-
void
HAL_FLASH_GetEraseByAddrOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
flash_addr
,
uint32_t
*
erased_size_byte
)
-
Get the last address erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address of the first page erased.
-
erased_size_byte – Size in bytes of the erased page.
-
-
void
HAL_FLASH_GetErasePageOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
*
bank
,
uint32_t
*
page
,
uint32_t
*
erased_page_nbr
)
-
Get the last page erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Erased bank.
-
page – Index of the first page erased.
-
erased_page_nbr – Number of page(s) erased.
-
-
hal_flash_bank_t
HAL_FLASH_GetEraseBankOperationInfo
(
const
hal_flash_handle_t
*
hflash
)
-
Get the last bank erase operation information.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_bank_t – Index of the erased bank.
-
void
HAL_FLASH_GetInterruptedByResetOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_interrupted_by_reset_operation_info_t
*
p_info
)
-
Get the interrupted Flash operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_interrupted_by_reset_operation_info_t structure.
-
-
void
HAL_FLASH_GetInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_info_t
*
p_info
)
-
Get the Flash general information (size, number and size of banks, number and size of pages).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_info_t structure.
-
-
void
HAL_FLASH_ECC_GetFailInfo
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_fail_info_t
*
p_info
)
-
Get the Flash ECC fail information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_ecc_fail_info_t structure.
-
-
uint32_t
HAL_FLASH_GetSizeByte
(
const
hal_flash_handle_t
*
hflash
)
-
Get the total Flash size (in bytes).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash size (in bytes).
-
uint8_t
HAL_FLASH_GetBankNbr
(
const
hal_flash_handle_t
*
hflash
)
-
Get the total Flash number of banks.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash number of banks.
-
uint32_t
HAL_FLASH_GetBankSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the total Flash size per bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – Total Flash size per bank (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the User Flash size of the specified bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash size of the specified bank (in bytes).
-
uint16_t
HAL_FLASH_GetUserFlashPageNbr
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the User Flash number of pages per bank.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash number of pages per bank.
-
uint32_t
HAL_FLASH_GetUserFlashPageSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
-
Get the User Flash size of the specified page (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page.
-
- Return values :
-
uint32_t – User Flash size of the specified page (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashAddrOffset
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
-
Get the User Flash offset address of the specified page.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page within the specified bank.
-
- Return values :
-
uint32_t – Offset address of the specified page.
-
hal_flash_state_t
HAL_FLASH_GetState
(
const
hal_flash_handle_t
*
hflash
)
-
Get the current Flash global state.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_state_t – Current global state of the Flash.
-
uint32_t
HAL_FLASH_GetLastErrorCodes
(
const
hal_flash_handle_t
*
hflash
)
-
Get the current Flash last error codes.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Flash last error codes.
-
void
HAL_FLASH_SetUserData
(
hal_flash_handle_t
*
hflash
,
const
void
*
p_user_data
)
-
Store the User data pointer within the Flash handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FLASH_GetUserData
(
const
hal_flash_handle_t
*
hflash
)
-
Retrieve the User data pointer from the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
void* – Pointer to the user data.
-
- group FLASH_Exported_Functions_Group5
-
This subsection provides functions to get Flash general data information and status:
-
Call HAL_FLASH_GetOperation() to get the last Flash ongoing operation.
-
Call HAL_FLASH_GetProgramOperationInfo() to get the last program operation info.
-
Call HAL_FLASH_GetEraseByAddrOperationInfo() to get the last erase by address operation info.
-
Call HAL_FLASH_GetErasePageOperationInfo() to get the last erase by page operation info.
-
Call HAL_FLASH_GetEraseBankOperationInfo() to get the last bank erase operation info.
-
Call HAL_FLASH_GetInterruptedByResetOperationInfo() to get the Flash interrupted operation info.
-
Call HAL_FLASH_GetInfo() to get the Flash memory organization information.
-
Call HAL_FLASH_ECC_GetFailInfo() to get the Flash ECC error information.
-
Call HAL_FLASH_GetSizeByte() to get the total Flash size in bytes.
-
Call HAL_FLASH_GetBankNbr() to get the total Flash number of banks.
-
Call HAL_FLASH_GetBankSizeByte() to get the total Flash size per bank.
-
Call HAL_FLASH_GetUserFlashSizeByte() to get the User Flash size in bytes of any given bank.
-
Call HAL_FLASH_GetUserFlashPageNbr() to get the User Flash number of pages per bank.
-
Call HAL_FLASH_GetUserFlashPageSizeByte() to get the User Flash size of any given page.
-
Call HAL_FLASH_GetUserFlashAddrOffset() to get the User Flash offset address of any given page.
-
Call HAL_FLASH_GetState() to get the Flash current state.
-
Call HAL_FLASH_GetLastErrorCodes() to get the Flash last error codes.
-
Call HAL_FLASH_SetUserData() to set user data in the Flash handle.
-
Call HAL_FLASH_GetUserData() to set user data from the Flash handle.
Functions
-
hal_flash_operation_t
HAL_FLASH_GetOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Get the last Flash operation.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_operation_t – The last operation performed.
-
void
HAL_FLASH_GetProgramOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
prog_flash_addr
,
uint32_t
*
prog_data_addr
,
uint32_t
*
programmed_data_byte
)
-
Get the last programming operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
prog_data_addr – Address of the data to be programmed.
-
prog_flash_addr – Address in the Flash where the data is programmed
-
programmed_data_byte – Size in bytes of the programmed data.
-
-
void
HAL_FLASH_GetEraseByAddrOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
uint32_t
*
flash_addr
,
uint32_t
*
erased_size_byte
)
-
Get the last address erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address of the first page erased.
-
erased_size_byte – Size in bytes of the erased page.
-
-
void
HAL_FLASH_GetErasePageOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
*
bank
,
uint32_t
*
page
,
uint32_t
*
erased_page_nbr
)
-
Get the last page erase operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Erased bank.
-
page – Index of the first page erased.
-
erased_page_nbr – Number of page(s) erased.
-
-
hal_flash_bank_t
HAL_FLASH_GetEraseBankOperationInfo
(
const
hal_flash_handle_t
*
hflash
)
-
Get the last bank erase operation information.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_bank_t – Index of the erased bank.
-
void
HAL_FLASH_GetInterruptedByResetOperationInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_interrupted_by_reset_operation_info_t
*
p_info
)
-
Get the interrupted Flash operation information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_interrupted_by_reset_operation_info_t structure.
-
-
void
HAL_FLASH_GetInfo
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_info_t
*
p_info
)
-
Get the Flash general information (size, number and size of banks, number and size of pages).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_info_t structure.
-
-
void
HAL_FLASH_ECC_GetFailInfo
(
hal_flash_handle_t
*
hflash
,
hal_flash_ecc_fail_info_t
*
p_info
)
-
Get the Flash ECC fail information.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_info – Pointer to a hal_flash_ecc_fail_info_t structure.
-
-
uint32_t
HAL_FLASH_GetSizeByte
(
const
hal_flash_handle_t
*
hflash
)
-
Get the total Flash size (in bytes).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash size (in bytes).
-
uint8_t
HAL_FLASH_GetBankNbr
(
const
hal_flash_handle_t
*
hflash
)
-
Get the total Flash number of banks.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Total Flash number of banks.
-
uint32_t
HAL_FLASH_GetBankSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the total Flash size per bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – Total Flash size per bank (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the User Flash size of the specified bank (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash size of the specified bank (in bytes).
-
uint16_t
HAL_FLASH_GetUserFlashPageNbr
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
)
-
Get the User Flash number of pages per bank.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
- Return values :
-
uint32_t – User Flash number of pages per bank.
-
uint32_t
HAL_FLASH_GetUserFlashPageSizeByte
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
-
Get the User Flash size of the specified page (in bytes).
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page.
-
- Return values :
-
uint32_t – User Flash size of the specified page (in bytes).
-
uint32_t
HAL_FLASH_GetUserFlashAddrOffset
(
const
hal_flash_handle_t
*
hflash
,
hal_flash_bank_t
bank
,
uint32_t
page
)
-
Get the User Flash offset address of the specified page.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
bank – Selected bank.
-
page – Selected page within the specified bank.
-
- Return values :
-
uint32_t – Offset address of the specified page.
-
hal_flash_state_t
HAL_FLASH_GetState
(
const
hal_flash_handle_t
*
hflash
)
-
Get the current Flash global state.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
hal_flash_state_t – Current global state of the Flash.
-
uint32_t
HAL_FLASH_GetLastErrorCodes
(
const
hal_flash_handle_t
*
hflash
)
-
Get the current Flash last error codes.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
uint32_t – Flash last error codes.
-
void
HAL_FLASH_SetUserData
(
hal_flash_handle_t
*
hflash
,
const
void
*
p_user_data
)
-
Store the User data pointer within the Flash handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_FLASH_GetUserData
(
const
hal_flash_handle_t
*
hflash
)
-
Retrieve the User data pointer from the Flash handle.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
void* – Pointer to the user data.
-
FLASH Private Functions ¶
- group FLASH_Private_Functions
-
This subsection provides a set of functions intrinsically called to manage various Flash operations:
-
FLASH_WaitForEndOfOperation() is called to wait for any ongoing Flash operation to be completed.
-
FLASH_CheckEndOfOperation() is called to check for any ongoing Flash operation if completed.
-
FLASH_HandleErrorIT() is called to handle any Flash error interrupt.
-
FLASH_UpdateAdaptiveProgrammingMode() is called to automatically adjust the programming size for a any program by address operation regardless of the programming data size given by the user.
-
FLASH_Program() is called to program a quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_Program_IT() is called to program a quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_ProgramByBurst() is called to perform a burst granularity data size program (8x quad-words).
-
FLASH_ProgramByQuadWord() is called to perform a quad-word granularity data size program (128 bits).
-
FLASH_EraseBank() is called to perform an erase by bank operation in polling mode.
-
FLASH_EraseBank_IT() is called to perform an erase by bank operation in interrupt mode.
-
FLASH_FillErrorCode() is called to fill the Flash last error codes filed within the handle.
-
FLASH_NS_CheckEndOfOperation() is called to check for an ongoing NSecure Flash operation if completed.
-
FLASH_NS_HandleErrorIT() is called to check for any ongoing NSecure Flash operation errors.
-
FLASH_NS_Program() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_NS_Program_IT() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_NS_ProgramByBurst() is called to perform a NSecure burst granularity data size program (8x quad-words).
-
FLASH_NS_ProgramByQuadWord() is called to perform a NSecure quad-word granularity data size program (128 bits).
-
FLASH_NS_EraseBank() is called to perform a NSecure erase by bank operation in polling mode.
-
FLASH_NS_EraseBank_IT() is called to perform a NSecure erase by bank operation in interrupt mode.
-
FLASH_NS_FillErrorCode() is called to fill the NSecure Flash last error codes filed within the handle.
Functions
-
hal_status_t
FLASH_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Wait for an ongoing Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Check the Flash last operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when an error occurred.
-
HAL_OK – No operation is waiting.
-
-
void
FLASH_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle any Flash error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
uint32_t
FLASH_UpdateAdaptiveProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Automatically Adjust the right programming size depending on the given data size by the user.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
count – Adapted data size count for each programming iteration.
-
hal_status_t
FLASH_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address in Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Operation completed successfully.
-
-
void
FLASH_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Perform a Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Perform a Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Erase by bank the Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erase operation is completed successfully.
-
-
void
FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
¶
-
Erase by bank the Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
¶
-
Fill the last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – Flash Error flags.
-
-
hal_status_t
FLASH_NS_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Wait for an ongoing NSecure Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_NS_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Check the Flash last NSecure operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked. Returned when there is already an ongoing Flash operation.
-
HAL_OK – No current ongoing Flash operation.
-
-
void
FLASH_NS_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
¶
-
Handle the Flash NSecure error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
¶
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_NS_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
¶
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
void
FLASH_NS_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Perform a NSecure Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
¶
-
Perform a NSecure Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
¶
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
status – Flash bank erase operation status.
-
void
FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
¶
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
¶
-
Fill the NSecure last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – NSecure Flash Error flags.
-
-
- group FLASH_Private_Functions
-
This subsection provides a set of functions intrinsically called to manage various Flash operations:
-
FLASH_WaitForEndOfOperation() is called to wait for any ongoing Flash operation to be completed.
-
FLASH_CheckEndOfOperation() is called to check for any ongoing Flash operation if completed.
-
FLASH_HandleErrorIT() is called to handle any Flash error interrupt.
-
FLASH_UpdateAdaptiveProgrammingMode() is called to automatically adjust the programming size for a any program by address operation regardless of the programming data size given by the user.
-
FLASH_Program() is called to program a quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_Program_IT() is called to program a quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_ProgramByBurst() is called to perform a burst granularity data size program (8x quad-words).
-
FLASH_ProgramByQuadWord() is called to perform a quad-word granularity data size program (128 bits).
-
FLASH_EraseBank() is called to perform an erase by bank operation in polling mode.
-
FLASH_EraseBank_IT() is called to perform an erase by bank operation in interrupt mode.
-
FLASH_FillErrorCode() is called to fill the Flash last error codes filed within the handle.
-
FLASH_NS_CheckEndOfOperation() is called to check for an ongoing NSecure Flash operation if completed.
-
FLASH_NS_HandleErrorIT() is called to check for any ongoing NSecure Flash operation errors.
-
FLASH_NS_Program() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_NS_Program_IT() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_NS_ProgramByBurst() is called to perform a NSecure burst granularity data size program (8x quad-words).
-
FLASH_NS_ProgramByQuadWord() is called to perform a NSecure quad-word granularity data size program (128 bits).
-
FLASH_NS_EraseBank() is called to perform a NSecure erase by bank operation in polling mode.
-
FLASH_NS_EraseBank_IT() is called to perform a NSecure erase by bank operation in interrupt mode.
-
FLASH_NS_FillErrorCode() is called to fill the NSecure Flash last error codes filed within the handle.
Functions
-
hal_status_t
FLASH_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Wait for an ongoing Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Check the Flash last operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when an error occurred.
-
HAL_OK – No operation is waiting.
-
-
void
FLASH_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
-
Handle any Flash error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
uint32_t
FLASH_UpdateAdaptiveProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
-
Automatically Adjust the right programming size depending on the given data size by the user.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
count – Adapted data size count for each programming iteration.
-
hal_status_t
FLASH_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address in Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Operation completed successfully.
-
-
void
FLASH_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Erase by bank the Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erase operation is completed successfully.
-
-
void
FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
-
Erase by bank the Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
-
Fill the last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – Flash Error flags.
-
-
hal_status_t
FLASH_NS_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Wait for an ongoing NSecure Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_NS_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Check the Flash last NSecure operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked. Returned when there is already an ongoing Flash operation.
-
HAL_OK – No current ongoing Flash operation.
-
-
void
FLASH_NS_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash NSecure error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_NS_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
void
FLASH_NS_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a NSecure Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a NSecure Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
status – Flash bank erase operation status.
-
void
FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
-
Fill the NSecure last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – NSecure Flash Error flags.
-
-
- group FLASH_Private_Functions
-
This subsection provides a set of functions intrinsically called to manage various Flash operations:
-
FLASH_WaitForEndOfOperation() is called to wait for any ongoing Flash operation to be completed.
-
FLASH_CheckEndOfOperation() is called to check for any ongoing Flash operation if completed.
-
FLASH_HandleErrorIT() is called to handle any Flash error interrupt.
-
FLASH_UpdateAdaptiveProgrammingMode() is called to automatically adjust the programming size for a any program by address operation regardless of the programming data size given by the user.
-
FLASH_Program() is called to program a quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_Program_IT() is called to program a quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_ProgramByBurst() is called to perform a burst granularity data size program (8x quad-words).
-
FLASH_ProgramByQuadWord() is called to perform a quad-word granularity data size program (128 bits).
-
FLASH_EraseBank() is called to perform an erase by bank operation in polling mode.
-
FLASH_EraseBank_IT() is called to perform an erase by bank operation in interrupt mode.
-
FLASH_FillErrorCode() is called to fill the Flash last error codes filed within the handle.
-
FLASH_NS_CheckEndOfOperation() is called to check for an ongoing NSecure Flash operation if completed.
-
FLASH_NS_HandleErrorIT() is called to check for any ongoing NSecure Flash operation errors.
-
FLASH_NS_Program() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in polling mode.
-
FLASH_NS_Program_IT() is called to program a NSecure quad-word or burst programming depending on the programming mode configuration in interrupt mode.
-
FLASH_NS_ProgramByBurst() is called to perform a NSecure burst granularity data size program (8x quad-words).
-
FLASH_NS_ProgramByQuadWord() is called to perform a NSecure quad-word granularity data size program (128 bits).
-
FLASH_NS_EraseBank() is called to perform a NSecure erase by bank operation in polling mode.
-
FLASH_NS_EraseBank_IT() is called to perform a NSecure erase by bank operation in interrupt mode.
-
FLASH_NS_FillErrorCode() is called to fill the NSecure Flash last error codes filed within the handle.
Functions
-
hal_status_t
FLASH_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Wait for an ongoing Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Check the Flash last operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when an error occurred.
-
HAL_OK – No operation is waiting.
-
-
void
FLASH_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
-
Handle any Flash error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
uint32_t
FLASH_UpdateAdaptiveProgrammingMode
(
const
hal_flash_handle_t
*
hflash
)
-
Automatically Adjust the right programming size depending on the given data size by the user.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
count – Adapted data size count for each programming iteration.
-
hal_status_t
FLASH_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Address in Flash memory to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Operation completed successfully.
-
-
void
FLASH_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Erase by bank the Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the erase operation is completed successfully.
-
-
void
FLASH_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
-
Erase by bank the Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
-
Fill the last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – Flash Error flags.
-
-
hal_status_t
FLASH_NS_WaitForEndOfOperation
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Wait for an ongoing NSecure Flash operation to be completed.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Maximum Flash operation timeout.
-
- Return values :
-
-
HAL_ERROR – There is an operation in progress.
-
HAL_OK – No operation is waiting.
-
-
hal_status_t
FLASH_NS_CheckEndOfOperation
(
const
hal_flash_handle_t
*
hflash
)
-
Check the Flash last NSecure operation if completed.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked. Returned when there is already an ongoing Flash operation.
-
HAL_OK – No current ongoing Flash operation.
-
-
void
FLASH_NS_HandleErrorIT
(
hal_flash_handle_t
*
hflash
)
-
Handle the Flash NSecure error interrupt.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_Program
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
,
uint32_t
timeout_msec
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
timeout_msec – Timeout value for programming operation.
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_TIMEOUT – Internal processing exceeded the timeout.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
hal_status_t
FLASH_NS_Program_IT
(
hal_flash_handle_t
*
hflash
,
uint32_t
flash_addr
,
const
uint32_t
*
p_data
,
uint32_t
size_byte
)
-
Program a quad-word (128-bit) or burst programming (8x quad-words) at a specified NSecure Flash address in interrupt mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flash_addr – Start address of Flash to be programmed.
-
p_data – Pointer to the data to be programmed.
-
size_byte – Size of the data to be programmed (in bytes).
-
- Return values :
-
-
HAL_ERROR – Returned when the control registers access is locked.
-
HAL_OK – Returned when the programming operation is completed successfully.
-
-
void
FLASH_NS_ProgramByBurst
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a NSecure Burst programming granularity (8x quad-words).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_ProgramByQuadWord
(
const
hal_flash_handle_t
*
hflash
)
-
Perform a NSecure Quad-word programming granularity (128-bit).
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
hal_status_t
FLASH_NS_EraseBank
(
hal_flash_handle_t
*
hflash
,
uint32_t
timeout_msec
)
-
Erase by bank the NSecure Flash memory area in polling mode.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
timeout_msec – Timeout value for erase operation.
-
- Return values :
-
status – Flash bank erase operation status.
-
void
FLASH_NS_EraseBank_IT
(
hal_flash_handle_t
*
hflash
)
-
Erase by bank the NSecure Flash memory area in interrupt mode.
- Parameters :
-
hflash – Pointer to a hal_flash_handle_t structure.
-
void
FLASH_NS_FillErrorCode
(
hal_flash_handle_t
*
hflash
,
uint32_t
flags
)
-
Fill the NSecure last error code within the handle.
- Parameters :
-
-
hflash – Pointer to a hal_flash_handle_t structure.
-
flags – NSecure Flash Error flags.
-
-