CARME-M4 BSP  V1.5

FLASH driver modules. More...

+ Collaboration diagram for FLASH:

Modules

 FLASH_Exported_Constants
 
 FLASH_Private_Functions
 

Macros

#define SECTOR_MASK   ((uint32_t)0xFFFFFF07)
 

Enumerations

enum  FLASH_Status {
  FLASH_BUSY = 1, FLASH_ERROR_RD, FLASH_ERROR_PGS, FLASH_ERROR_PGP,
  FLASH_ERROR_PGA, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_ERROR_OPERATION,
  FLASH_COMPLETE
}
 FLASH Status.
 

Functions

void FLASH_SetLatency (uint32_t FLASH_Latency)
 Sets the code latency value. More...
 
void FLASH_PrefetchBufferCmd (FunctionalState NewState)
 Enables or disables the Prefetch Buffer. More...
 
void FLASH_InstructionCacheCmd (FunctionalState NewState)
 Enables or disables the Instruction Cache feature. More...
 
void FLASH_DataCacheCmd (FunctionalState NewState)
 Enables or disables the Data Cache feature. More...
 
void FLASH_InstructionCacheReset (void)
 Resets the Instruction Cache. More...
 
void FLASH_DataCacheReset (void)
 Resets the Data Cache. More...
 
void FLASH_Unlock (void)
 Unlocks the FLASH control register access. More...
 
void FLASH_Lock (void)
 Locks the FLASH control register access. More...
 
FLASH_Status FLASH_EraseSector (uint32_t FLASH_Sector, uint8_t VoltageRange)
 Erases a specified FLASH Sector. More...
 
FLASH_Status FLASH_EraseAllSectors (uint8_t VoltageRange)
 Erases all FLASH Sectors. More...
 
FLASH_Status FLASH_EraseAllBank1Sectors (uint8_t VoltageRange)
 Erases all FLASH Sectors in Bank 1. More...
 
FLASH_Status FLASH_EraseAllBank2Sectors (uint8_t VoltageRange)
 Erases all FLASH Sectors in Bank 2. More...
 
FLASH_Status FLASH_ProgramDoubleWord (uint32_t Address, uint64_t Data)
 Programs a double word (64-bit) at a specified 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_ProgramHalfWord (uint32_t Address, uint16_t Data)
 Programs a half word (16-bit) at a specified address. More...
 
FLASH_Status FLASH_ProgramByte (uint32_t Address, uint8_t Data)
 Programs a byte (8-bit) at a specified address. More...
 
void FLASH_OB_Unlock (void)
 Unlocks the FLASH Option Control Registers access. More...
 
void FLASH_OB_Lock (void)
 Locks the FLASH Option Control Registers access. More...
 
void FLASH_OB_WRPConfig (uint32_t OB_WRP, FunctionalState NewState)
 Enables or disables the write protection of the desired sectors, for the first 1 Mb of the Flash. More...
 
void FLASH_OB_WRP1Config (uint32_t OB_WRP, FunctionalState NewState)
 Enables or disables the write protection of the desired sectors, for the second 1 Mb of the Flash. More...
 
void FLASH_OB_PCROPSelectionConfig (uint8_t OB_PcROP)
 Select the Protection Mode (SPRMOD). More...
 
void FLASH_OB_PCROPConfig (uint32_t OB_PCROP, FunctionalState NewState)
 Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of the Flash. More...
 
void FLASH_OB_PCROP1Config (uint32_t OB_PCROP, FunctionalState NewState)
 Enables or disables the read/write protection (PCROP) of the desired sectors. More...
 
void FLASH_OB_RDPConfig (uint8_t OB_RDP)
 Sets the read protection level. More...
 
void FLASH_OB_UserConfig (uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
 Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. More...
 
void FLASH_OB_BORConfig (uint8_t OB_BOR)
 Sets the BOR Level. More...
 
void FLASH_OB_BootConfig (uint8_t OB_BOOT)
 Configure the Dual Bank Boot. More...
 
FLASH_Status FLASH_OB_Launch (void)
 Launch the option byte loading. More...
 
uint8_t FLASH_OB_GetUser (void)
 Returns the FLASH User Option Bytes values. More...
 
uint16_t FLASH_OB_GetWRP (void)
 Returns the FLASH Write Protection Option Bytes value. More...
 
uint16_t FLASH_OB_GetWRP1 (void)
 Returns the FLASH Write Protection Option Bytes value. More...
 
uint16_t FLASH_OB_GetPCROP (void)
 Returns the FLASH PC Read/Write Protection Option Bytes value. More...
 
uint16_t FLASH_OB_GetPCROP1 (void)
 Returns the FLASH PC Read/Write Protection Option Bytes value. More...
 
FlagStatus FLASH_OB_GetRDP (void)
 Returns the FLASH Read Protection level. More...
 
uint8_t FLASH_OB_GetBOR (void)
 Returns the FLASH BOR level. 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 (void)
 Waits for a FLASH operation to complete. More...
 

Detailed Description

FLASH driver modules.

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
  • FLASH_FLAG_RDERR: FLASH Read Protection error flag (STM32F42/43xxx and STM32F401xx devices)
Return values
None

Definition at line 1481 of file stm32f4xx_flash.c.

void FLASH_DataCacheCmd ( FunctionalState  NewState)

Enables or disables the Data Cache feature.

Parameters
NewStatenew state of the Data Cache. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 306 of file stm32f4xx_flash.c.

void FLASH_DataCacheReset ( void  )

Resets the Data Cache.

Note
This function must be used only when the Data Cache is disabled.
Parameters
None
Return values
None

Definition at line 338 of file stm32f4xx_flash.c.

FLASH_Status FLASH_EraseAllBank1Sectors ( uint8_t  VoltageRange)

Erases all FLASH Sectors in Bank 1.

Note
This function can be used only for STM32F42xxx/43xxx devices.
If an erase and a program operations are requested simultaneously, the erase operation is performed before the program one.
Parameters
VoltageRangeThe device voltage range which defines the erase parallelism. This parameter can be one of the following values:
  • VoltageRange_1: when the device voltage range is 1.8V to 2.1V, the operation will be done by byte (8-bit)
  • VoltageRange_2: when the device voltage range is 2.1V to 2.7V, the operation will be done by half word (16-bit)
  • VoltageRange_3: when the device voltage range is 2.7V to 3.6V, the operation will be done by word (32-bit)
  • VoltageRange_4: when the device voltage range is 2.7V to 3.6V + External Vpp, the operation will be done by double word (64-bit)
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 586 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_EraseAllBank2Sectors ( uint8_t  VoltageRange)

Erases all FLASH Sectors in Bank 2.

Note
This function can be used only for STM32F42xxx/43xxx devices.
If an erase and a program operations are requested simultaneously, the erase operation is performed before the program one.
Parameters
VoltageRangeThe device voltage range which defines the erase parallelism. This parameter can be one of the following values:
  • VoltageRange_1: when the device voltage range is 1.8V to 2.1V, the operation will be done by byte (8-bit)
  • VoltageRange_2: when the device voltage range is 2.1V to 2.7V, the operation will be done by half word (16-bit)
  • VoltageRange_3: when the device voltage range is 2.7V to 3.6V, the operation will be done by word (32-bit)
  • VoltageRange_4: when the device voltage range is 2.7V to 3.6V + External Vpp, the operation will be done by double word (64-bit)
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 653 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_EraseAllSectors ( uint8_t  VoltageRange)

Erases all FLASH Sectors.

Note
If an erase and a program operations are requested simustaneously, the erase operation is performed before the program one.
Parameters
VoltageRangeThe device voltage range which defines the erase parallelism. This parameter can be one of the following values:
  • VoltageRange_1: when the device voltage range is 1.8V to 2.1V, the operation will be done by byte (8-bit)
  • VoltageRange_2: when the device voltage range is 2.1V to 2.7V, the operation will be done by half word (16-bit)
  • VoltageRange_3: when the device voltage range is 2.7V to 3.6V, the operation will be done by word (32-bit)
  • VoltageRange_4: when the device voltage range is 2.7V to 3.6V + External Vpp, the operation will be done by double word (64-bit)
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 505 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_EraseSector ( uint32_t  FLASH_Sector,
uint8_t  VoltageRange 
)

Erases a specified FLASH Sector.

Note
If an erase and a program operations are requested simustaneously, the erase operation is performed before the program one.
Parameters
FLASH_SectorThe Sector number to be erased.
Note
For STM32F405xx/407xx and STM32F415xx/417xx devices this parameter can be a value between FLASH_Sector_0 and FLASH_Sector_11.

For STM32F42xxx/43xxx devices this parameter can be a value between FLASH_Sector_0 and FLASH_Sector_23.

For STM32F401xx devices this parameter can be a value between FLASH_Sector_0 and FLASH_Sector_5.

Parameters
VoltageRangeThe device voltage range which defines the erase parallelism. This parameter can be one of the following values:
  • VoltageRange_1: when the device voltage range is 1.8V to 2.1V, the operation will be done by byte (8-bit)
  • VoltageRange_2: when the device voltage range is 2.1V to 2.7V, the operation will be done by half word (16-bit)
  • VoltageRange_3: when the device voltage range is 2.7V to 3.6V, the operation will be done by word (32-bit)
  • VoltageRange_4: when the device voltage range is 2.7V to 3.6V + External Vpp, the operation will be done by double word (64-bit)
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 437 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

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_RDERR: FLASH (PCROP) Read Protection error flag (STM32F42/43xxx and STM32F401xx devices)
  • FLASH_FLAG_BSY: FLASH Busy flag
Return values
Thenew state of FLASH_FLAG (SET or RESET).

Definition at line 1450 of file stm32f4xx_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_RD, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 1496 of file stm32f4xx_flash.c.

+ Here is the caller graph for this function:

void FLASH_InstructionCacheCmd ( FunctionalState  NewState)

Enables or disables the Instruction Cache feature.

Parameters
NewStatenew state of the Instruction Cache. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 285 of file stm32f4xx_flash.c.

void FLASH_InstructionCacheReset ( void  )

Resets the Instruction Cache.

Note
This function must be used only when the Instruction Cache is disabled.
Parameters
None
Return values
None

Definition at line 327 of file stm32f4xx_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

Definition at line 1418 of file stm32f4xx_flash.c.

void FLASH_Lock ( void  )

Locks the FLASH control register access.

Parameters
None
Return values
None

Definition at line 400 of file stm32f4xx_flash.c.

void FLASH_OB_BootConfig ( uint8_t  OB_BOOT)

Configure the Dual Bank Boot.

Note
This function can be used only for STM32F42xxx/43xxx devices.
Parameters
OB_BOOTspecifies the Dual Bank Boot Option byte. This parameter can be one of the following values:
  • OB_Dual_BootEnabled: Dual Bank Boot Enable
  • OB_Dual_BootDisabled: Dual Bank Boot Disabled
Return values
None

Definition at line 1242 of file stm32f4xx_flash.c.

void FLASH_OB_BORConfig ( uint8_t  OB_BOR)

Sets the BOR Level.

Parameters
OB_BORspecifies the Option Bytes BOR Reset Level. This parameter can be one of the following values:
  • OB_BOR_LEVEL3: Supply voltage ranges from 2.7 to 3.6 V
  • OB_BOR_LEVEL2: Supply voltage ranges from 2.4 to 2.7 V
  • OB_BOR_LEVEL1: Supply voltage ranges from 2.1 to 2.4 V
  • OB_BOR_OFF: Supply voltage ranges from 1.62 to 2.1 V
Return values
None

Definition at line 1263 of file stm32f4xx_flash.c.

uint8_t FLASH_OB_GetBOR ( void  )

Returns the FLASH BOR level.

Parameters
None
Return values
TheFLASH BOR level:
  • OB_BOR_LEVEL3: Supply voltage ranges from 2.7 to 3.6 V
  • OB_BOR_LEVEL2: Supply voltage ranges from 2.4 to 2.7 V
  • OB_BOR_LEVEL1: Supply voltage ranges from 2.1 to 2.4 V
  • OB_BOR_OFF : Supply voltage ranges from 1.62 to 2.1 V

Definition at line 1389 of file stm32f4xx_flash.c.

uint16_t FLASH_OB_GetPCROP ( void  )

Returns the FLASH PC Read/Write Protection Option Bytes value.

Note
This function can be used only for STM32F42xxx/43xxx devices and STM32F401xx devices.
Parameters
None
Return values
TheFLASH PC Read/Write Protection Option Bytes value

Definition at line 1338 of file stm32f4xx_flash.c.

uint16_t FLASH_OB_GetPCROP1 ( void  )

Returns the FLASH PC Read/Write Protection Option Bytes value.

Note
This function can be used only for STM32F42xxx/43xxx devices.
Parameters
None
Return values
TheFLASH PC Read/Write Protection Option Bytes value

Definition at line 1352 of file stm32f4xx_flash.c.

FlagStatus FLASH_OB_GetRDP ( void  )

Returns the FLASH Read Protection level.

Parameters
None
Return values
FLASHReadOut Protection Status:
  • SET, when OB_RDP_Level_1 or OB_RDP_Level_2 is set
  • RESET, when OB_RDP_Level_0 is set

Definition at line 1365 of file stm32f4xx_flash.c.

uint8_t FLASH_OB_GetUser ( void  )

Returns the FLASH User Option Bytes values.

Parameters
None
Return values
TheFLASH User Option Bytes values: IWDG_SW(Bit0), RST_STOP(Bit1) and RST_STDBY(Bit2).

Definition at line 1299 of file stm32f4xx_flash.c.

uint16_t FLASH_OB_GetWRP ( void  )

Returns the FLASH Write Protection Option Bytes value.

Parameters
None
Return values
TheFLASH Write Protection Option Bytes value

Definition at line 1310 of file stm32f4xx_flash.c.

uint16_t FLASH_OB_GetWRP1 ( void  )

Returns the FLASH Write Protection Option Bytes value.

Note
This function can be used only for STM32F42xxx/43xxx devices.
Parameters
None
Return values
TheFLASH Write Protection Option Bytes value

Definition at line 1324 of file stm32f4xx_flash.c.

FLASH_Status FLASH_OB_Launch ( void  )

Launch the option byte loading.

Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 1280 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_Lock ( void  )

Locks the FLASH Option Control Registers access.

Parameters
None
Return values
None

Definition at line 951 of file stm32f4xx_flash.c.

void FLASH_OB_PCROP1Config ( uint32_t  OB_PCROP,
FunctionalState  NewState 
)

Enables or disables the read/write protection (PCROP) of the desired sectors.

Note
This function can be used only for STM32F42xxx/43xxx devices.
Parameters
OB_PCROPspecifies the sector(s) to be read/write protected or unprotected. This parameter can be one of the following values:
  • OB_PCROP: A value between OB_PCROP_Sector12 and OB_PCROP_Sector23
  • OB_PCROP_Sector_All
Newstatenew state of the Write Protection. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1133 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_PCROPConfig ( uint32_t  OB_PCROP,
FunctionalState  NewState 
)

Enables or disables the read/write protection (PCROP) of the desired sectors, for the first 1 MB of the Flash.

Note
This function can be used only for STM32F42xxx/43xxx and STM32F401xx devices.
Parameters
OB_PCROPspecifies the sector(s) to be read/write protected or unprotected. This parameter can be one of the following values:
  • OB_PCROP: A value between OB_PCROP_Sector0 and OB_PCROP_Sector11 for STM32F42xxx/43xxx devices and between OB_PCROP_Sector0 and OB_PCROP_Sector5 for STM32F401xx devices.
  • OB_PCROP_Sector_All
Newstatenew state of the Write Protection. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1096 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_PCROPSelectionConfig ( uint8_t  OB_PcROP)

Select the Protection Mode (SPRMOD).

Note
This function can be used only for STM32F42xxx/43xxx and STM32F401xx devices.
After PCROP activation, Option Byte modification is not possible. Exception made for the global Read Out Protection modification level (level1 to level0)
Once SPRMOD bit is active unprotection of a protected sector is not possible
Read a protected sector will set RDERR Flag and write a protected sector will set WRPERR Flag
Some Precautions should be taken when activating the PCROP feature : The active value of nWRPi bits is inverted when PCROP mode is active, this means if SPRMOD = 1 and WRPi = 1 (default value), then the user sector i is read/write protected. In order to avoid activation of PCROP Mode for undesired sectors, please follow the below safety sequence :
  • Disable PCROP for all Sectors using FLASH_OB_PCROPConfig(OB_PCROP_Sector_All, DISABLE) function for Bank1 or FLASH_OB_PCROP1Config(OB_PCROP_Sector_All, DISABLE) function for Bank2
  • Enable PCROP for the desired Sector i using FLASH_OB_PCROPConfig(Sector i, ENABLE) function
  • Activate the PCROP Mode FLASH_OB_PCROPSelectionConfig() function.
Parameters
OB_PCROPSelect the Protection Mode of nWPRi bits This parameter can be one of the following values:
  • OB_PcROP_Disable: nWRPi control the write protection of respective user sectors.
  • OB_PcROP_Enable: nWRPi control the read&write protection (PCROP) of respective user sectors.
Return values
None

Definition at line 1066 of file stm32f4xx_flash.c.

void FLASH_OB_RDPConfig ( uint8_t  OB_RDP)

Sets the read protection level.

Parameters
OB_RDPspecifies the read protection level. This parameter can be one of the following values:
  • OB_RDP_Level_0: No protection
  • OB_RDP_Level_1: Read protection of the memory
  • OB_RDP_Level_2: Full chip protection
/!\ Warning /!\ When enabling OB_RDP level 2 it's no more possible to go back to level 1 or 0
Return values
None

Definition at line 1169 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_Unlock ( void  )

Unlocks the FLASH Option Control Registers access.

Parameters
None
Return values
None

Definition at line 936 of file stm32f4xx_flash.c.

void FLASH_OB_UserConfig ( uint8_t  OB_IWDG,
uint8_t  OB_STOP,
uint8_t  OB_STDBY 
)

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

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
None

Definition at line 1201 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_WRP1Config ( uint32_t  OB_WRP,
FunctionalState  NewState 
)

Enables or disables the write protection of the desired sectors, for the second 1 Mb of the Flash.

Note
This function can be used only for STM32F42xxx/43xxx devices.
When the memory read out protection is selected (RDP level = 1), it is not possible to program or erase the flash sector i if CortexM4 debug features are connected or boot code is executed in RAM, even if nWRPi = 1
Active value of nWRPi bits is inverted when PCROP mode is active (SPRMOD =1).
Parameters
OB_WRPspecifies the sector(s) to be write protected or unprotected. This parameter can be one of the following values:
  • OB_WRP: A value between OB_WRP_Sector12 and OB_WRP_Sector23
  • OB_WRP_Sector_All
Newstatenew state of the Write Protection. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1016 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_OB_WRPConfig ( uint32_t  OB_WRP,
FunctionalState  NewState 
)

Enables or disables the write protection of the desired sectors, for the first 1 Mb of the Flash.

Note
When the memory read protection level is selected (RDP level = 1), it is not possible to program or erase the flash sector i if CortexM4 debug features are connected or boot code is executed in RAM, even if nWRPi = 1
Active value of nWRPi bits is inverted when PCROP mode is active (SPRMOD =1).
Parameters
OB_WRPspecifies the sector(s) to be write protected or unprotected. This parameter can be one of the following values:
  • OB_WRP: A value between OB_WRP_Sector0 and OB_WRP_Sector11
  • OB_WRP_Sector_All
Newstatenew state of the Write Protection. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 974 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

void FLASH_PrefetchBufferCmd ( FunctionalState  NewState)

Enables or disables the Prefetch Buffer.

Parameters
NewStatenew state of the Prefetch Buffer. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 263 of file stm32f4xx_flash.c.

FLASH_Status FLASH_ProgramByte ( uint32_t  Address,
uint8_t  Data 
)

Programs a byte (8-bit) at a specified address.

Note
This function can be used within all the device supply voltage ranges.
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.

Definition at line 837 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_ProgramDoubleWord ( uint32_t  Address,
uint64_t  Data 
)

Programs a double word (64-bit) at a specified address.

Note
This function must be used when the device voltage range is from 2.7V to 3.6V and an External Vpp is present.
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.
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.

Definition at line 710 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_ProgramHalfWord ( uint32_t  Address,
uint16_t  Data 
)

Programs a half word (16-bit) 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.

Definition at line 795 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

FLASH_Status FLASH_ProgramWord ( uint32_t  Address,
uint32_t  Data 
)

Programs a word (32-bit) 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.

Definition at line 753 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

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
  • FLASH_Latency_8: FLASH Eight Latency cycles
  • FLASH_Latency_9: FLASH Nine Latency cycles
  • FLASH_Latency_10: FLASH Teen Latency cycles
  • FLASH_Latency_11: FLASH Eleven Latency cycles
  • FLASH_Latency_12: FLASH Twelve Latency cycles
  • FLASH_Latency_13: FLASH Thirteen Latency cycles
  • FLASH_Latency_14: FLASH Fourteen Latency cycles
  • FLASH_Latency_15: FLASH Fifteen Latency cycles
Note
For STM32F405xx/407xx, STM32F415xx/417xx and STM32F401xx devices this parameter can be a value between FLASH_Latency_0 and FLASH_Latency_7.
For STM32F42xxx/43xxx devices this parameter can be a value between FLASH_Latency_0 and FLASH_Latency_15.
Return values
None

Definition at line 248 of file stm32f4xx_flash.c.

void FLASH_Unlock ( void  )

Unlocks the FLASH control register access.

Parameters
None
Return values
None

Definition at line 385 of file stm32f4xx_flash.c.

FLASH_Status FLASH_WaitForLastOperation ( void  )

Waits for a FLASH operation to complete.

Parameters
None
Return values
FLASHStatus: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE.

Definition at line 1546 of file stm32f4xx_flash.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: