Sets the code latency value.
1 This driver provides functions to configure and program the Flash memory of all STM32F10x devices,
2 including the latest STM32F10x_XL density devices.
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.
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.
13 The table below presents the list of available functions depending on the used STM32F10x devices.
16 Legacy functions used for all STM32F10x devices *
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 +----------------------------------------------------------------------------------------------------------------------------------+
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) *
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 +----------------------------------------------------------------------------------------------------------------------------------+
101 New Functions used only with STM32F10x_XL density devices to manage Bank2 *
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 +----------------------------------------------------------------------------------------------------------------------------------+