STM32F1 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F1 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Groups
FLASH_Exported_Functions

Functions

void FLASH_SetLatency (uint32_t FLASH_Latency)
 Sets the code latency value. More...
 
void FLASH_HalfCycleAccessCmd (uint32_t FLASH_HalfCycleAccess)
 Enables or disables the Half cycle flash access. More...
 
void FLASH_PrefetchBufferCmd (uint32_t FLASH_PrefetchBuffer)
 Enables or disables the Prefetch Buffer. More...
 
void FLASH_Unlock (void)
 Unlocks the FLASH Program Erase Controller. More...
 
void FLASH_Lock (void)
 Locks the FLASH Program Erase Controller. More...
 
FLASH_Status FLASH_ErasePage (uint32_t Page_Address)
 Erases a specified FLASH page. More...
 
FLASH_Status FLASH_EraseAllPages (void)
 Erases all FLASH pages. More...
 
FLASH_Status FLASH_EraseOptionBytes (void)
 Erases the FLASH option bytes. More...
 
FLASH_Status FLASH_ProgramWord (uint32_t Address, uint32_t Data)
 Programs a word at a specified address. More...
 
FLASH_Status FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word at a specified address. More...
 
FLASH_Status FLASH_ProgramOptionByteData (uint32_t Address, uint8_t Data)
 Programs a half word at a specified Option Byte Data address. More...
 
FLASH_Status FLASH_EnableWriteProtection (uint32_t FLASH_Pages)
 Write protects the desired pages. More...
 
FLASH_Status FLASH_ReadOutProtection (FunctionalState NewState)
 Enables or disables the read out protection. More...
 
FLASH_Status FLASH_UserOptionByteConfig (uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY)
 Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. More...
 
uint32_t FLASH_GetUserOptionByte (void)
 Returns the FLASH User Option Bytes values. More...
 
uint32_t FLASH_GetWriteProtectionOptionByte (void)
 Returns the FLASH Write Protection Option Bytes Register value. More...
 
FlagStatus FLASH_GetReadOutProtectionStatus (void)
 Checks whether the FLASH Read Out Protection Status is set or not. More...
 
FlagStatus FLASH_GetPrefetchBufferStatus (void)
 Checks whether the FLASH Prefetch Buffer status is set or not. More...
 
void FLASH_ITConfig (uint32_t FLASH_IT, FunctionalState NewState)
 Enables or disables the specified FLASH interrupts. More...
 
FlagStatus FLASH_GetFlagStatus (uint32_t FLASH_FLAG)
 Checks whether the specified FLASH flag is set or not. More...
 
void FLASH_ClearFlag (uint32_t FLASH_FLAG)
 Clears the FLASH’s pending flags. More...
 
FLASH_Status FLASH_GetStatus (void)
 Returns the FLASH Status. More...
 
FLASH_Status FLASH_WaitForLastOperation (uint32_t Timeout)
 Waits for a Flash operation to complete or a TIMEOUT to occur. More...
 
void FLASH_UnlockBank1 (void)
 Unlocks the FLASH Bank1 Program Erase Controller. More...
 
void FLASH_LockBank1 (void)
 Locks the FLASH Bank1 Program Erase Controller. More...
 
FLASH_Status FLASH_EraseAllBank1Pages (void)
 Erases all Bank1 FLASH pages. More...
 
FLASH_Status FLASH_GetBank1Status (void)
 Returns the FLASH Bank1 Status. More...
 
FLASH_Status FLASH_WaitForLastBank1Operation (uint32_t Timeout)
 Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur. More...
 

Detailed Description

Function Documentation

void FLASH_ClearFlag ( uint32_t  FLASH_FLAG)

Clears the FLASH’s pending flags.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices, this function clears Bank1 or Bank2’s pending flags
  • For other devices, it clears Bank1’s pending flags.
Parameters
FLASH_FLAG,:specifies the FLASH flags to clear. This parameter can be any combination of the following values:
  • FLASH_FLAG_PGERR: FLASH Program error flag
  • FLASH_FLAG_WRPRTERR: FLASH Write protected error flag
  • FLASH_FLAG_EOP: FLASH End of Operation flag
Return values
None
FLASH_Status FLASH_EnableWriteProtection ( uint32_t  FLASH_Pages)

Write protects the desired pages.

Note
This function can be used for all STM32F10x devices.
Parameters
FLASH_Pages,:specifies the address of the pages to be write protected. This parameter can be:
  • For STM32_Low-density_devices: value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages28to31
  • For STM32_Medium-density_devices: value between FLASH_WRProt_Pages0to3 and FLASH_WRProt_Pages124to127
  • For STM32_High-density_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to255
  • For STM32_Connectivity_line_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to127
  • For STM32_XL-density_devices: value between FLASH_WRProt_Pages0to1 and FLASH_WRProt_Pages60to61 or FLASH_WRProt_Pages62to511
  • FLASH_WRProt_AllPages
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_EraseAllBank1Pages ( void  )

Erases all Bank1 FLASH pages.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices this function erases all Bank1 pages.
  • For all other devices it erases all Bank1 pages and it is equivalent to FLASH_EraseAllPages function.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_EraseAllPages ( void  )

Erases all FLASH pages.

Note
This function can be used for all STM32F10x devices.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_EraseOptionBytes ( void  )

Erases the FLASH option bytes.

Note
This functions erases all option bytes except the Read protection (RDP).
This function can be used for all STM32F10x devices.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ErasePage ( uint32_t  Page_Address)

Erases a specified FLASH page.

Note
This function can be used for all STM32F10x devices.
Parameters
Page_Address,:The page address to be erased.
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_GetBank1Status ( void  )

Returns the FLASH Bank1 Status.

Note
This function can be used for all STM32F10x devices, it is equivalent to FLASH_GetStatus function.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP or FLASH_COMPLETE
FlagStatus FLASH_GetFlagStatus ( uint32_t  FLASH_FLAG)

Checks whether the specified FLASH flag is set or not.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices, this function checks whether the specified Bank1 or Bank2 flag is set or not.
  • For other devices, it checks whether the specified Bank1 flag is set or not.
Parameters
FLASH_FLAG,:specifies the FLASH flag to check. This parameter can be one of the following values:
  • FLASH_FLAG_BSY: FLASH Busy flag
  • FLASH_FLAG_PGERR: FLASH Program error flag
  • FLASH_FLAG_WRPRTERR: FLASH Write protected error flag
  • FLASH_FLAG_EOP: FLASH End of Operation flag
  • FLASH_FLAG_OPTERR: FLASH Option Byte error flag
Return values
Thenew state of FLASH_FLAG (SET or RESET).
FlagStatus FLASH_GetPrefetchBufferStatus ( void  )

Checks whether the FLASH Prefetch Buffer status is set or not.

Note
This function can be used for all STM32F10x devices.
Parameters
None
Return values
FLASHPrefetch Buffer Status (SET or RESET).
FlagStatus FLASH_GetReadOutProtectionStatus ( void  )

Checks whether the FLASH Read Out Protection Status is set or not.

Note
This function can be used for all STM32F10x devices.
Parameters
None
Return values
FLASHReadOut Protection Status(SET or RESET)
FLASH_Status FLASH_GetStatus ( void  )

Returns the FLASH Status.

Note
This function can be used for all STM32F10x devices, it is equivalent to FLASH_GetBank1Status function.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP or FLASH_COMPLETE
uint32_t FLASH_GetUserOptionByte ( void  )

Returns the FLASH User Option Bytes values.

Note
This function can be used for all STM32F10x devices.
Parameters
None
Return values
TheFLASH User Option Bytes values:IWDG_SW(Bit0), RST_STOP(Bit1) and RST_STDBY(Bit2).
uint32_t FLASH_GetWriteProtectionOptionByte ( void  )

Returns the FLASH Write Protection Option Bytes Register value.

Note
This function can be used for all STM32F10x devices.
Parameters
None
Return values
TheFLASH Write Protection Option Bytes Register value
void FLASH_HalfCycleAccessCmd ( uint32_t  FLASH_HalfCycleAccess)

Enables or disables the Half cycle flash access.

Note
This function can be used for all STM32F10x devices.
Parameters
FLASH_HalfCycleAccess,:specifies the FLASH Half cycle Access mode. This parameter can be one of the following values:
  • FLASH_HalfCycleAccess_Enable: FLASH Half Cycle Enable
  • FLASH_HalfCycleAccess_Disable: FLASH Half Cycle Disable
Return values
None
void FLASH_ITConfig ( uint32_t  FLASH_IT,
FunctionalState  NewState 
)

Enables or disables the specified FLASH interrupts.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices, enables or disables the specified FLASH interrupts for Bank1 and Bank2.
  • For other devices it enables or disables the specified FLASH interrupts for Bank1.
Parameters
FLASH_IT,:specifies the FLASH interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
  • FLASH_IT_ERROR: FLASH Error Interrupt
  • FLASH_IT_EOP: FLASH end of operation Interrupt
NewState,:new state of the specified Flash interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None
void FLASH_Lock ( void  )

Locks the FLASH Program Erase Controller.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices this function Locks Bank1 and Bank2.
  • For all other devices it Locks Bank1 and it is equivalent to FLASH_LockBank1 function.
Parameters
None
Return values
None
void FLASH_LockBank1 ( void  )

Locks the FLASH Bank1 Program Erase Controller.

Note
this function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices this function Locks Bank1.
  • For all other devices it Locks Bank1 and it is equivalent to FLASH_Lock function.
Parameters
None
Return values
None
void FLASH_PrefetchBufferCmd ( uint32_t  FLASH_PrefetchBuffer)

Enables or disables the Prefetch Buffer.

Note
This function can be used for all STM32F10x devices.
Parameters
FLASH_PrefetchBuffer,:specifies the Prefetch buffer status. This parameter can be one of the following values:
  • FLASH_PrefetchBuffer_Enable: FLASH Prefetch Buffer Enable
  • FLASH_PrefetchBuffer_Disable: FLASH Prefetch Buffer Disable
Return values
None
FLASH_Status FLASH_ProgramHalfWord ( uint32_t  Address,
uint16_t  Data 
)

Programs a half word at a specified address.

Note
This function can be used for all STM32F10x devices.
Parameters
Address,:specifies the address to be programmed.
Data,:specifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ProgramOptionByteData ( uint32_t  Address,
uint8_t  Data 
)

Programs a half word at a specified Option Byte Data address.

Note
This function can be used for all STM32F10x devices.
Parameters
Address,:specifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806.
Data,:specifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ProgramWord ( uint32_t  Address,
uint32_t  Data 
)

Programs a word at a specified address.

Note
This function can be used for all STM32F10x devices.
Parameters
Address,:specifies the address to be programmed.
Data,:specifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_ReadOutProtection ( FunctionalState  NewState)

Enables or disables the read out protection.

Note
If the user has already programmed the other option bytes before calling this function, he must re-program them since this function erases all option bytes.
This function can be used for all STM32F10x devices.
Parameters
Newstate,:new state of the ReadOut Protection. This parameter can be: ENABLE or DISABLE.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
void FLASH_SetLatency ( uint32_t  FLASH_Latency)

Sets the code latency value.

This driver provides functions to configure and program the Flash memory of all STM32F10x devices,
including the latest STM32F10x_XL density devices.
STM32F10x_XL devices feature up to 1 Mbyte with dual bank architecture for read-while-write (RWW) capability:
- bank1: fixed size of 512 Kbytes (256 pages of 2Kbytes each)
- bank2: up to 512 Kbytes (up to 256 pages of 2Kbytes each)
While other STM32F10x devices features only one bank with memory up to 512 Kbytes.
In version V3.3.0, some functions were updated and new ones were added to support
STM32F10x_XL devices. Thus some functions manages all devices, while other are
dedicated for XL devices only.
The table below presents the list of available functions depending on the used STM32F10x devices.
Legacy functions used for all STM32F10x devices *
+----------------------------------------------------------------------------------------------------------------------------------+
| Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
| | devices | devices | |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_SetLatency | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_HalfCycleAccessCmd | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_PrefetchBufferCmd | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_Unlock | Yes | Yes | - For STM32F10X_XL devices: unlock Bank1 and Bank2. |
| | | | - For other devices: unlock Bank1 and it is equivalent |
| | | | to FLASH_UnlockBank1 function. |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_Lock | Yes | Yes | - For STM32F10X_XL devices: lock Bank1 and Bank2. |
| | | | - For other devices: lock Bank1 and it is equivalent |
| | | | to FLASH_LockBank1 function. |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ErasePage | Yes | Yes | - For STM32F10x_XL devices: erase a page in Bank1 and Bank2 |
| | | | - For other devices: erase a page in Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_EraseAllPages | Yes | Yes | - For STM32F10x_XL devices: erase all pages in Bank1 and Bank2 |
| | | | - For other devices: erase all pages in Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_EraseOptionBytes | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ProgramWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ProgramHalfWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ProgramOptionByteData | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_EnableWriteProtection | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ReadOutProtection | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_UserOptionByteConfig | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetUserOptionByte | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetWriteProtectionOptionByte | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetReadOutProtectionStatus | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetPrefetchBufferStatus | Yes | Yes | No change |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ITConfig | Yes | Yes | - For STM32F10x_XL devices: enable Bank1 and Bank2's interrupts|
| | | | - For other devices: enable Bank1's interrupts |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetFlagStatus | Yes | Yes | - For STM32F10x_XL devices: return Bank1 and Bank2's flag status|
| | | | - For other devices: return Bank1's flag status |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_ClearFlag | Yes | Yes | - For STM32F10x_XL devices: clear Bank1 and Bank2's flag |
| | | | - For other devices: clear Bank1's flag |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_GetStatus | Yes | Yes | - Return the status of Bank1 (for all devices) |
| | | | equivalent to FLASH_GetBank1Status function |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_WaitForLastOperation | Yes | Yes | - Wait for Bank1 last operation (for all devices) |
| | | | equivalent to: FLASH_WaitForLastBank1Operation function |
+----------------------------------------------------------------------------------------------------------------------------------+
New functions used for all STM32F10x devices to manage Bank1: *
- These functions are mainly useful for STM32F10x_XL density devices, to have separate control for Bank1 and bank2 *
- For other devices, these functions are optional (covered by functions listed above) *
+----------------------------------------------------------------------------------------------------------------------------------+
| Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
| | devices | devices | |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_UnlockBank1 | Yes | Yes | - Unlock Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_LockBank1 | Yes | Yes | - Lock Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_EraseAllBank1Pages | Yes | Yes | - Erase all pages in Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_GetBank1Status | Yes | Yes | - Return the status of Bank1 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_WaitForLastBank1Operation | Yes | Yes | - Wait for Bank1 last operation |
+----------------------------------------------------------------------------------------------------------------------------------+
New Functions used only with STM32F10x_XL density devices to manage Bank2 *
+----------------------------------------------------------------------------------------------------------------------------------+
| Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
| | devices | devices | |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_UnlockBank2 | Yes | No | - Unlock Bank2 |
|----------------------------------------------------------------------------------------------------------------------------------|
|FLASH_LockBank2 | Yes | No | - Lock Bank2 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_EraseAllBank2Pages | Yes | No | - Erase all pages in Bank2 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_GetBank2Status | Yes | No | - Return the status of Bank2 |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_WaitForLastBank2Operation | Yes | No | - Wait for Bank2 last operation |
|----------------------------------------------------------------------------------------------------------------------------------|
| FLASH_BootConfig | Yes | No | - Configure to boot from Bank1 or Bank2 |
+----------------------------------------------------------------------------------------------------------------------------------+
Note
This function can be used for all STM32F10x devices.
Parameters
FLASH_Latency,:specifies the FLASH Latency value. This parameter can be one of the following values:
  • FLASH_Latency_0: FLASH Zero Latency cycle
  • FLASH_Latency_1: FLASH One Latency cycle
  • FLASH_Latency_2: FLASH Two Latency cycles
Return values
None
void FLASH_Unlock ( void  )

Unlocks the FLASH Program Erase Controller.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices this function unlocks Bank1 and Bank2.
  • For all other devices it unlocks Bank1 and it is equivalent to FLASH_UnlockBank1 function..
Parameters
None
Return values
None
void FLASH_UnlockBank1 ( void  )

Unlocks the FLASH Bank1 Program Erase Controller.

Note
This function can be used for all STM32F10x devices.
  • For STM32F10X_XL devices this function unlocks Bank1.
  • For all other devices it unlocks Bank1 and it is equivalent to FLASH_Unlock function.
Parameters
None
Return values
None
FLASH_Status FLASH_UserOptionByteConfig ( uint16_t  OB_IWDG,
uint16_t  OB_STOP,
uint16_t  OB_STDBY 
)

Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.

Note
This function can be used for all STM32F10x devices.
Parameters
OB_IWDG,:Selects the IWDG mode This parameter can be one of the following values:
  • OB_IWDG_SW: Software IWDG selected
  • OB_IWDG_HW: Hardware IWDG selected
OB_STOP,:Reset event when entering STOP mode. This parameter can be one of the following values:
  • OB_STOP_NoRST: No reset generated when entering in STOP
  • OB_STOP_RST: Reset generated when entering in STOP
OB_STDBY,:Reset event when entering Standby mode. This parameter can be one of the following values:
  • OB_STDBY_NoRST: No reset generated when entering in STANDBY
  • OB_STDBY_RST: Reset generated when entering in STANDBY
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_WaitForLastBank1Operation ( uint32_t  Timeout)

Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur.

Note
This function can be used for all STM32F10x devices, it is equivalent to FLASH_WaitForLastOperation.
Parameters
Timeout,:FLASH progamming Timeout
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
FLASH_Status FLASH_WaitForLastOperation ( uint32_t  Timeout)

Waits for a Flash operation to complete or a TIMEOUT to occur.

Note
This function can be used for all STM32F10x devices, it is equivalent to FLASH_WaitForLastBank1Operation.
  • For STM32F10X_XL devices this function waits for a Bank1 Flash operation to complete or a TIMEOUT to occur.
  • For all other devices it waits for a Flash operation to complete or a TIMEOUT to occur.
Parameters
Timeout,:FLASH progamming Timeout
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.