STM32F103xB HAL User Manual
Functions
Programming operation functions
FLASH Exported Functions

Programming operation functions. More...

Functions

HAL_StatusTypeDef HAL_FLASH_Program (uint32_t TypeProgram, uint32_t Address, uint64_t Data)
 Program halfword, word or double word at a specified address.
HAL_StatusTypeDef HAL_FLASH_Program_IT (uint32_t TypeProgram, uint32_t Address, uint64_t Data)
 Program halfword, word or double word at a specified address with interrupt enabled.
void HAL_FLASH_IRQHandler (void)
 This function handles FLASH interrupt request.
__weak void HAL_FLASH_EndOfOperationCallback (uint32_t ReturnValue)
 FLASH end of operation interrupt callback.
__weak void HAL_FLASH_OperationErrorCallback (uint32_t ReturnValue)
 FLASH operation error interrupt callback.

Detailed Description

Programming operation functions.


Function Documentation

void HAL_FLASH_EndOfOperationCallback ( uint32_t  ReturnValue)

FLASH end of operation interrupt callback.

Parameters:
ReturnValue,:The value saved in this parameter depends on the ongoing procedure
  • Mass Erase: No return value expected
  • Pages Erase: Address of the page which has been erased (if 0xFFFFFFFF, it means that all the selected pages have been erased)
  • Program: Address which was selected for data program
Return values:
none

Definition at line 606 of file stm32f1xx_hal_flash.c.

Referenced by HAL_FLASH_IRQHandler().

void HAL_FLASH_IRQHandler ( void  )
void HAL_FLASH_OperationErrorCallback ( uint32_t  ReturnValue)

FLASH operation error interrupt callback.

Parameters:
ReturnValue,:The value saved in this parameter depends on the ongoing procedure
  • Mass Erase: No return value expected
  • Pages Erase: Address of the page which returned an error
  • Program: Address which was selected for data program
Return values:
none

Definition at line 624 of file stm32f1xx_hal_flash.c.

Referenced by HAL_FLASH_IRQHandler().

HAL_StatusTypeDef HAL_FLASH_Program ( uint32_t  TypeProgram,
uint32_t  Address,
uint64_t  Data 
)

Program halfword, word or double word at a specified address.

Note:
The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface The function HAL_FLASH_Lock() should be called after to lock the FLASH interface
If an erase and a program operations are requested simultaneously, the erase operation is performed before the program one.
FLASH should be previously erased before new programmation (only exception to this is when 0x0000 is programmed)
Parameters:
TypeProgram,:Indicate the way to program at a specified address. This parameter can be a value of FLASH Type Program
Address,:Specifies the address to be programmed.
Data,:Specifies the data to be programmed
Return values:
HAL_StatusTypeDefHAL Status

Definition at line 168 of file stm32f1xx_hal_flash.c.

References assert_param, FLASH_Program_HalfWord(), FLASH_TIMEOUT_VALUE, FLASH_TYPEPROGRAM_HALFWORD, FLASH_TYPEPROGRAM_WORD, FLASH_WaitForLastOperation(), IS_FLASH_PROGRAM_ADDRESS, and IS_FLASH_TYPEPROGRAM.

HAL_StatusTypeDef HAL_FLASH_Program_IT ( uint32_t  TypeProgram,
uint32_t  Address,
uint64_t  Data 
)

Program halfword, word or double word at a specified address with interrupt enabled.

Note:
The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface The function HAL_FLASH_Lock() should be called after to lock the FLASH interface
If an erase and a program operations are requested simultaneously, the erase operation is performed before the program one.
Parameters:
TypeProgram,:Indicate the way to program at a specified address. This parameter can be a value of FLASH Type Program
Address,:Specifies the address to be programmed.
Data,:Specifies the data to be programmed
Return values:
HAL_StatusTypeDefHAL Status

Definition at line 267 of file stm32f1xx_hal_flash.c.

References __HAL_FLASH_ENABLE_IT, FLASH_ProcessTypeDef::Address, assert_param, FLASH_ProcessTypeDef::Data, FLASH_ProcessTypeDef::DataRemaining, FLASH_IT_EOP, FLASH_IT_ERR, FLASH_PROC_NONE, FLASH_PROC_PROGRAMDOUBLEWORD, FLASH_PROC_PROGRAMHALFWORD, FLASH_PROC_PROGRAMWORD, FLASH_Program_HalfWord(), FLASH_TYPEPROGRAM_HALFWORD, FLASH_TYPEPROGRAM_WORD, IS_FLASH_PROGRAM_ADDRESS, IS_FLASH_TYPEPROGRAM, and FLASH_ProcessTypeDef::ProcedureOnGoing.