Functions
Collaboration diagram for FLASH_Exported_Functions:

Functions

void FLASH_ClearFlag (uint32_t FLASH_FLAG)
 Clears the FLASH's pending flags. More...
 
FLASH_Status FLASH_EnableWriteProtection (uint32_t FLASH_Pages)
 Write protects the desired pages. More...
 
FLASH_Status FLASH_EraseAllBank1Pages (void)
 Erases all Bank1 FLASH pages. 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_ErasePage (uint32_t Page_Address)
 Erases a specified FLASH page. More...
 
FLASH_Status FLASH_GetBank1Status (void)
 Returns the FLASH Bank1 Status. More...
 
FlagStatus FLASH_GetFlagStatus (uint32_t FLASH_FLAG)
 Checks whether the specified FLASH flag is set or not. More...
 
FlagStatus FLASH_GetPrefetchBufferStatus (void)
 Checks whether the FLASH Prefetch Buffer status is set or not. More...
 
FlagStatus FLASH_GetReadOutProtectionStatus (void)
 Checks whether the FLASH Read Out Protection Status is set or not. More...
 
FLASH_Status FLASH_GetStatus (void)
 Returns the FLASH Status. 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...
 
void FLASH_HalfCycleAccessCmd (uint32_t FLASH_HalfCycleAccess)
 Enables or disables the Half cycle flash access. More...
 
void FLASH_ITConfig (uint32_t FLASH_IT, FunctionalState NewState)
 Enables or disables the specified FLASH interrupts. More...
 
void FLASH_Lock (void)
 Locks the FLASH control register access. More...
 
void FLASH_LockBank1 (void)
 Locks the FLASH Bank1 Program Erase Controller. More...
 
void FLASH_PrefetchBufferCmd (uint32_t FLASH_PrefetchBuffer)
 Enables or disables the Prefetch Buffer. More...
 
FLASH_Status FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word (16-bit) 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_ProgramWord (uint32_t Address, uint32_t Data)
 Programs a word (32-bit) at a specified address. More...
 
FLASH_Status FLASH_ReadOutProtection (FunctionalState NewState)
 Enables or disables the read out protection. More...
 
void FLASH_SetLatency (uint32_t FLASH_Latency)
 Sets the code latency value. More...
 
void FLASH_Unlock (void)
 Unlocks the FLASH control register access. More...
 
void FLASH_UnlockBank1 (void)
 Unlocks the FLASH Bank1 Program Erase Controller. 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...
 
FLASH_Status FLASH_WaitForLastBank1Operation (uint32_t Timeout)
 Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur. More...
 
FLASH_Status FLASH_WaitForLastOperation (uint32_t Timeout)
 Waits for a Flash operation 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.

Parameters
FLASH_FLAGspecifies the FLASH flags to clear. This parameter can be any combination of the following values:
  • FLASH_FLAG_EOP: FLASH End of Operation flag
  • FLASH_FLAG_OPERR: FLASH operation Error flag
  • FLASH_FLAG_WRPERR: FLASH Write protected error flag
  • FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
  • FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag
  • FLASH_FLAG_PGSERR: FLASH Programming Sequence error flag
Return values
None
Parameters
FLASH_FLAGspecifies the FLASH flags to clear. This parameter can be any combination of the following values:
  • FLASH_FLAG_PGERR: FLASH Programming error flag flag
  • FLASH_FLAG_WRPERR: FLASH Write protected error flag
  • FLASH_FLAG_EOP: FLASH End of Programming flag
Return values
None
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_FLAGspecifies 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

Definition at line 1084 of file stm32f4xx_flash.c.

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_Pagesspecifies 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.

Definition at line 975 of file stm32f10x_flash.c.

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.

Definition at line 555 of file stm32f10x_flash.c.

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.
Note
To correctly run this function, the FLASH_Unlock() function must be called before. all the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 492 of file stm32f10x_flash.c.

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.

Definition at line 616 of file stm32f10x_flash.c.

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_AddressThe 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.

Erases a specified FLASH page.

Note
To correctly run this function, the FLASH_Unlock() function must be called before.
Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Page_AddressThe page address in program memory to be erased.
Note
A Page is erased in the Program memory only if the address to load is the start address of a page (multiple of 1024 bytes).
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 419 of file stm32f10x_flash.c.

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

Definition at line 1515 of file stm32f10x_flash.c.

FlagStatus FLASH_GetFlagStatus ( uint32_t  FLASH_FLAG)

Checks whether the specified FLASH flag is set or not.

Parameters
FLASH_FLAGspecifies the FLASH flag to check. This parameter can be one of the following values:
  • FLASH_FLAG_EOP: FLASH End of Operation flag
  • FLASH_FLAG_OPERR: FLASH operation Error flag
  • FLASH_FLAG_WRPERR: FLASH Write protected error flag
  • FLASH_FLAG_PGAERR: FLASH Programming Alignment error flag
  • FLASH_FLAG_PGPERR: FLASH Programming Parallelism error flag
  • FLASH_FLAG_PGSERR: FLASH Programming Sequence error flag
  • FLASH_FLAG_BSY: FLASH Busy flag
Return values
Thenew state of FLASH_FLAG (SET or RESET).
Parameters
FLASH_FLAGspecifies the FLASH flag to check. This parameter can be one of the following values:
  • FLASH_FLAG_BSY: FLASH write/erase operations in progress flag
  • FLASH_FLAG_PGERR: FLASH Programming error flag flag
  • FLASH_FLAG_WRPERR: FLASH Write protected error flag
  • FLASH_FLAG_EOP: FLASH End of Programming flag
Return values
Thenew state of FLASH_FLAG (SET or RESET).
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_FLAGspecifies 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).

Definition at line 1054 of file stm32f4xx_flash.c.

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).

Definition at line 1260 of file stm32f10x_flash.c.

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)

Definition at line 1240 of file stm32f10x_flash.c.

FLASH_Status FLASH_GetStatus ( void  )

Returns the FLASH Status.

Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP or FLASH_COMPLETE.
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

Definition at line 1099 of file stm32f4xx_flash.c.

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).

Definition at line 1216 of file stm32f10x_flash.c.

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

Definition at line 1228 of file stm32f10x_flash.c.

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_HalfCycleAccessspecifies 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

Definition at line 281 of file stm32f10x_flash.c.

void FLASH_ITConfig ( uint32_t  FLASH_IT,
FunctionalState  NewState 
)

Enables or disables the specified FLASH interrupts.

Parameters
FLASH_ITspecifies the FLASH interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
  • FLASH_IT_ERR: FLASH Error Interrupt
  • FLASH_IT_EOP: FLASH end of operation Interrupt
Return values
None
Parameters
FLASH_ITspecifies the FLASH interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
  • FLASH_IT_EOP: FLASH end of programming Interrupt
  • FLASH_IT_ERR: FLASH Error Interrupt
Return values
None
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_ITspecifies 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
NewStatenew state of the specified Flash interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1023 of file stm32f4xx_flash.c.

void FLASH_Lock ( void  )

Locks the FLASH control register access.

Parameters
None
Return values
NoneLocks the FLASH control register access.
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

Definition at line 332 of file stm32f4xx_flash.c.

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

Definition at line 392 of file stm32f10x_flash.c.

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_PrefetchBufferspecifies 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

Definition at line 300 of file stm32f10x_flash.c.

FLASH_Status FLASH_ProgramHalfWord ( uint32_t  Address,
uint16_t  Data 
)

Programs a half word (16-bit) at a specified address.

Programs a half word at a specified address.

Note
This function must be used when the device voltage range is from 2.1V to 3.6V.
If an erase and a program operations are requested simustaneously, the erase operation is performed before the program one.
Parameters
Addressspecifies the address to be programmed. This parameter can be any address in Program memory zone or in OTP zone.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
Note
To correctly run this function, the FLASH_Unlock() function must be called before. Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Addressspecifies the address to be programmed.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Programs a half word (16-bit) at a specified address.

Note
This function can be used for all STM32F10x devices.
Parameters
Addressspecifies the address to be programmed.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 589 of file stm32f4xx_flash.c.

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
Addressspecifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.
Note
To correctly run this function, the FLASH_OB_Unlock() function must be called before. Call the FLASH_OB_Lock() to disable the flash control register access and the option bytes (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Addressspecifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 929 of file stm32f10x_flash.c.

FLASH_Status FLASH_ProgramWord ( uint32_t  Address,
uint32_t  Data 
)

Programs a word (32-bit) at a specified address.

Programs a word at a specified address.

Note
This function must be used when the device voltage range is from 2.7V to 3.6V.
If an erase and a program operations are requested simustaneously, the erase operation is performed before the program one.
Parameters
Addressspecifies the address to be programmed. This parameter can be any address in Program memory zone or in OTP zone.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.
Note
To correctly run this function, the FLASH_Unlock() function must be called before. Call the FLASH_Lock() to disable the flash memory access (recommended to protect the FLASH memory against possible unwanted operation)
Parameters
Addressspecifies the address to be programmed.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Programs a word (32-bit) at a specified address.

Note
This function can be used for all STM32F10x devices.
Parameters
Addressspecifies the address to be programmed.
Dataspecifies the data to be programmed.
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 547 of file stm32f4xx_flash.c.

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
Newstatenew 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.

Definition at line 1049 of file stm32f10x_flash.c.

void FLASH_SetLatency ( uint32_t  FLASH_Latency)

Sets the code latency value.

Parameters
FLASH_Latencyspecifies 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
  • FLASH_Latency_3: FLASH Three Latency cycles
  • FLASH_Latency_4: FLASH Four Latency cycles
  • FLASH_Latency_5: FLASH Five Latency cycles
  • FLASH_Latency_6: FLASH Six Latency cycles
  • FLASH_Latency_7: FLASH Seven Latency cycles For STM32F40xx/41xx and STM32F427x/437x devices this parameter can be a value between FLASH_Latency_0 and FLASH_Latency_7.
Return values
None
Parameters
FLASH_Latencyspecifies 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
1 This driver provides functions to configure and program the Flash memory of all STM32F10x devices,
2 including the latest STM32F10x_XL density devices.
3 
4 STM32F10x_XL devices feature up to 1 Mbyte with dual bank architecture for read-while-write (RWW) capability:
5  - bank1: fixed size of 512 Kbytes (256 pages of 2Kbytes each)
6  - bank2: up to 512 Kbytes (up to 256 pages of 2Kbytes each)
7 While other STM32F10x devices features only one bank with memory up to 512 Kbytes.
8 
9 In version V3.3.0, some functions were updated and new ones were added to support
10 STM32F10x_XL devices. Thus some functions manages all devices, while other are
11 dedicated for XL devices only.
12 
13 The table below presents the list of available functions depending on the used STM32F10x devices.
14 
15 
16  Legacy functions used for all STM32F10x devices *
17 
18  +----------------------------------------------------------------------------------------------------------------------------------+
19  | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
20  | | devices | devices | |
21  |----------------------------------------------------------------------------------------------------------------------------------|
22  |FLASH_SetLatency | Yes | Yes | No change |
23  |----------------------------------------------------------------------------------------------------------------------------------|
24  |FLASH_HalfCycleAccessCmd | Yes | Yes | No change |
25  |----------------------------------------------------------------------------------------------------------------------------------|
26  |FLASH_PrefetchBufferCmd | Yes | Yes | No change |
27  |----------------------------------------------------------------------------------------------------------------------------------|
28  |FLASH_Unlock | Yes | Yes | - For STM32F10X_XL devices: unlock Bank1 and Bank2. |
29  | | | | - For other devices: unlock Bank1 and it is equivalent |
30  | | | | to FLASH_UnlockBank1 function. |
31  |----------------------------------------------------------------------------------------------------------------------------------|
32  |FLASH_Lock | Yes | Yes | - For STM32F10X_XL devices: lock Bank1 and Bank2. |
33  | | | | - For other devices: lock Bank1 and it is equivalent |
34  | | | | to FLASH_LockBank1 function. |
35  |----------------------------------------------------------------------------------------------------------------------------------|
36  |FLASH_ErasePage | Yes | Yes | - For STM32F10x_XL devices: erase a page in Bank1 and Bank2 |
37  | | | | - For other devices: erase a page in Bank1 |
38  |----------------------------------------------------------------------------------------------------------------------------------|
39  |FLASH_EraseAllPages | Yes | Yes | - For STM32F10x_XL devices: erase all pages in Bank1 and Bank2 |
40  | | | | - For other devices: erase all pages in Bank1 |
41  |----------------------------------------------------------------------------------------------------------------------------------|
42  |FLASH_EraseOptionBytes | Yes | Yes | No change |
43  |----------------------------------------------------------------------------------------------------------------------------------|
44  |FLASH_ProgramWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) |
45  |----------------------------------------------------------------------------------------------------------------------------------|
46  |FLASH_ProgramHalfWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) |
47  |----------------------------------------------------------------------------------------------------------------------------------|
48  |FLASH_ProgramOptionByteData | Yes | Yes | No change |
49  |----------------------------------------------------------------------------------------------------------------------------------|
50  |FLASH_EnableWriteProtection | Yes | Yes | No change |
51  |----------------------------------------------------------------------------------------------------------------------------------|
52  |FLASH_ReadOutProtection | Yes | Yes | No change |
53  |----------------------------------------------------------------------------------------------------------------------------------|
54  |FLASH_UserOptionByteConfig | Yes | Yes | No change |
55  |----------------------------------------------------------------------------------------------------------------------------------|
56  |FLASH_GetUserOptionByte | Yes | Yes | No change |
57  |----------------------------------------------------------------------------------------------------------------------------------|
58  |FLASH_GetWriteProtectionOptionByte | Yes | Yes | No change |
59  |----------------------------------------------------------------------------------------------------------------------------------|
60  |FLASH_GetReadOutProtectionStatus | Yes | Yes | No change |
61  |----------------------------------------------------------------------------------------------------------------------------------|
62  |FLASH_GetPrefetchBufferStatus | Yes | Yes | No change |
63  |----------------------------------------------------------------------------------------------------------------------------------|
64  |FLASH_ITConfig | Yes | Yes | - For STM32F10x_XL devices: enable Bank1 and Bank2's interrupts|
65  | | | | - For other devices: enable Bank1's interrupts |
66  |----------------------------------------------------------------------------------------------------------------------------------|
67  |FLASH_GetFlagStatus | Yes | Yes | - For STM32F10x_XL devices: return Bank1 and Bank2's flag status|
68  | | | | - For other devices: return Bank1's flag status |
69  |----------------------------------------------------------------------------------------------------------------------------------|
70  |FLASH_ClearFlag | Yes | Yes | - For STM32F10x_XL devices: clear Bank1 and Bank2's flag |
71  | | | | - For other devices: clear Bank1's flag |
72  |----------------------------------------------------------------------------------------------------------------------------------|
73  |FLASH_GetStatus | Yes | Yes | - Return the status of Bank1 (for all devices) |
74  | | | | equivalent to FLASH_GetBank1Status function |
75  |----------------------------------------------------------------------------------------------------------------------------------|
76  |FLASH_WaitForLastOperation | Yes | Yes | - Wait for Bank1 last operation (for all devices) |
77  | | | | equivalent to: FLASH_WaitForLastBank1Operation function |
78  +----------------------------------------------------------------------------------------------------------------------------------+
79 
80 
81  New functions used for all STM32F10x devices to manage Bank1: *
82  - These functions are mainly useful for STM32F10x_XL density devices, to have separate control for Bank1 and bank2 *
83  - For other devices, these functions are optional (covered by functions listed above) *
84 
85  +----------------------------------------------------------------------------------------------------------------------------------+
86  | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
87  | | devices | devices | |
88  |----------------------------------------------------------------------------------------------------------------------------------|
89  | FLASH_UnlockBank1 | Yes | Yes | - Unlock Bank1 |
90  |----------------------------------------------------------------------------------------------------------------------------------|
91  |FLASH_LockBank1 | Yes | Yes | - Lock Bank1 |
92  |----------------------------------------------------------------------------------------------------------------------------------|
93  | FLASH_EraseAllBank1Pages | Yes | Yes | - Erase all pages in Bank1 |
94  |----------------------------------------------------------------------------------------------------------------------------------|
95  | FLASH_GetBank1Status | Yes | Yes | - Return the status of Bank1 |
96  |----------------------------------------------------------------------------------------------------------------------------------|
97  | FLASH_WaitForLastBank1Operation | Yes | Yes | - Wait for Bank1 last operation |
98  +----------------------------------------------------------------------------------------------------------------------------------+
99 
100 
101  New Functions used only with STM32F10x_XL density devices to manage Bank2 *
102 
103  +----------------------------------------------------------------------------------------------------------------------------------+
104  | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
105  | | devices | devices | |
106  |----------------------------------------------------------------------------------------------------------------------------------|
107  | FLASH_UnlockBank2 | Yes | No | - Unlock Bank2 |
108  |----------------------------------------------------------------------------------------------------------------------------------|
109  |FLASH_LockBank2 | Yes | No | - Lock Bank2 |
110  |----------------------------------------------------------------------------------------------------------------------------------|
111  | FLASH_EraseAllBank2Pages | Yes | No | - Erase all pages in Bank2 |
112  |----------------------------------------------------------------------------------------------------------------------------------|
113  | FLASH_GetBank2Status | Yes | No | - Return the status of Bank2 |
114  |----------------------------------------------------------------------------------------------------------------------------------|
115  | FLASH_WaitForLastBank2Operation | Yes | No | - Wait for Bank2 last operation |
116  |----------------------------------------------------------------------------------------------------------------------------------|
117  | FLASH_BootConfig | Yes | No | - Configure to boot from Bank1 or Bank2 |
118  +----------------------------------------------------------------------------------------------------------------------------------+
Note
This function can be used for all STM32F10x devices.
Parameters
FLASH_Latencyspecifies 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

Definition at line 183 of file stm32f4xx_flash.c.

void FLASH_Unlock ( void  )

Unlocks the FLASH control register access.

Parameters
None
Return values
NoneUnlocks the FLASH control register access.
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

Definition at line 317 of file stm32f4xx_flash.c.

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

Definition at line 340 of file stm32f10x_flash.c.

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_IWDGSelects 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_STOPReset 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_STDBYReset 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.

Definition at line 1118 of file stm32f10x_flash.c.

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
TimeoutFLASH programming Timeout
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 1623 of file stm32f10x_flash.c.

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
TimeoutFLASH programming Timeout
Return values
FLASHStatus: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

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

Parameters
TimeoutFLASH programming Timeout
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT.

Definition at line 1595 of file stm32f10x_flash.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:23