FLASH Interface configuration functions.
More...
FLASH Interface configuration functions.
===============================================================================
FLASH Interface configuration functions
===============================================================================
This group includes the following functions:
- void FLASH_SetLatency(uint32_t FLASH_Latency)
To correctly read data from FLASH memory, the number of wait states (LATENCY)
must be correctly programmed according to the frequency of the CPU clock
(HCLK) and the supply voltage of the device.
+-------------------------------------------------------------------------------------+
| Latency | HCLK clock frequency (MHz) |
| |---------------------------------------------------------------------|
| | voltage range | voltage range | voltage range | voltage range |
| | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V |
|---------------|----------------|----------------|-----------------|-----------------|
|0WS(1CPU cycle)|0 < HCLK <= 30 |0 < HCLK <= 24 |0 < HCLK <= 18 |0 < HCLK <= 16 |
|---------------|----------------|----------------|-----------------|-----------------|
|1WS(2CPU cycle)|30 < HCLK <= 60 |24 < HCLK <= 48 |18 < HCLK <= 36 |16 < HCLK <= 32 |
|---------------|----------------|----------------|-----------------|-----------------|
|2WS(3CPU cycle)|60 < HCLK <= 90 |48 < HCLK <= 72 |36 < HCLK <= 54 |32 < HCLK <= 48 |
|---------------|----------------|----------------|-----------------|-----------------|
|3WS(4CPU cycle)|90 < HCLK <= 120|72 < HCLK <= 96 |54 < HCLK <= 72 |48 < HCLK <= 64 |
|---------------|----------------|----------------|-----------------|-----------------|
|4WS(5CPU cycle)|120< HCLK <= 150|96 < HCLK <= 120|72 < HCLK <= 90 |64 < HCLK <= 80 |
|---------------|----------------|----------------|-----------------|-----------------|
|5WS(6CPU cycle)|120< HCLK <= 168|120< HCLK <= 144|90 < HCLK <= 108 |80 < HCLK <= 96 |
|---------------|----------------|----------------|-----------------|-----------------|
|6WS(7CPU cycle)| NA |144< HCLK <= 168|108 < HCLK <= 120|96 < HCLK <= 112 |
|---------------|----------------|----------------|-----------------|-----------------|
|7WS(8CPU cycle)| NA | NA |120 < HCLK <= 138|112 < HCLK <= 120|
|***************|****************|****************|*****************|*****************|*****************************+
| | voltage range | voltage range | voltage range | voltage range | voltage range 2.7 V - 3.6 V |
| | 2.7 V - 3.6 V | 2.4 V - 2.7 V | 2.1 V - 2.4 V | 1.8 V - 2.1 V | with External Vpp = 9V |
|---------------|----------------|----------------|-----------------|-----------------|-----------------------------|
|Max Parallelism| x32 | x16 | x8 | x64 |
|---------------|----------------|----------------|-----------------|-----------------|-----------------------------|
|PSIZE[1:0] | 10 | 01 | 00 | 11 |
+-------------------------------------------------------------------------------------------------------------------+
@note When VOS bit (in PWR_CR register) is reset to '0’, the maximum value of HCLK is 144 MHz.
You can use PWR_MainRegulatorModeConfig() function to set or reset this bit.
- void FLASH_PrefetchBufferCmd(FunctionalState NewState)
- void FLASH_InstructionCacheCmd(FunctionalState NewState)
- void FLASH_DataCacheCmd(FunctionalState NewState)
- void FLASH_InstructionCacheReset(void)
- void FLASH_DataCacheReset(void)
The unlock sequence is not needed for these functions.
void FLASH_DataCacheCmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables the Data Cache feature.
- Parameters
-
NewState,: | new state of the Data Cache. This parameter can be: ENABLE or DISABLE. |
- Return values
-
void FLASH_DataCacheReset |
( |
void |
| ) |
|
Resets the Data Cache.
- Note
- This function must be used only when the Data Cache is disabled.
- Parameters
-
- Return values
-
void FLASH_InstructionCacheCmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables the Instruction Cache feature.
- Parameters
-
NewState,: | new state of the Instruction Cache. This parameter can be: ENABLE or DISABLE. |
- Return values
-
void FLASH_InstructionCacheReset |
( |
void |
| ) |
|
Resets the Instruction Cache.
- Note
- This function must be used only when the Instruction Cache is disabled.
- Parameters
-
- Return values
-
void FLASH_PrefetchBufferCmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables the Prefetch Buffer.
- Parameters
-
NewState,: | new state of the Prefetch Buffer. This parameter can be: ENABLE or DISABLE. |
- Return values
-
void FLASH_SetLatency |
( |
uint32_t |
FLASH_Latency | ) |
|
Sets the code latency value.
- 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
- 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
|
- Return values
-