?? stm32f10x_flash.lst
字號(hào):
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM 07/Aug/2011 12:10:37 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10 #
# x_StdPeriph_Driver\src\stm32f10x_flash.c #
# Command line = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10 #
# x_StdPeriph_Driver\src\stm32f10x_flash.c -D #
# USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
# sh\Obj\ --no_cse --no_unroll --no_inline #
# --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --endian=little --cpu=Cortex-M3 #
# -e --fpu=None --dlib_config #
# D:\arm\INC\c\DLib_Config_Normal.h -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ #
# -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
# \ST\CMSIS\CM3\CoreSupport\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \STM32F10x_StdPeriph_Driver\inc\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
# OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
# \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
# S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
# \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
# re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
# CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
# .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline #
# List file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\stm32f10x_flash.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \stm32f10x_flash.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c
1 /**
2 ******************************************************************************
3 * @file stm32f10x_flash.c
4 * @author MCD Application Team
5 * @version V3.4.0
6 * @date 10/15/2010
7 * @brief This file provides all the FLASH firmware functions.
8 ******************************************************************************
9 * @copy
10 *
11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 *
18 * <h2><center>© COPYRIGHT 2010 STMicroelectronics</center></h2>
19 */
20
21 /* Includes ------------------------------------------------------------------*/
22 #include "stm32f10x_flash.h"
23
24 /** @addtogroup STM32F10x_StdPeriph_Driver
25 * @{
26 */
27
28 /** @defgroup FLASH
29 * @brief FLASH driver modules
30 * @{
31 */
32
33 /** @defgroup FLASH_Private_TypesDefinitions
34 * @{
35 */
36
37 /**
38 * @}
39 */
40
41 /** @defgroup FLASH_Private_Defines
42 * @{
43 */
44
45 /* Flash Access Control Register bits */
46 #define ACR_LATENCY_Mask ((uint32_t)0x00000038)
47 #define ACR_HLFCYA_Mask ((uint32_t)0xFFFFFFF7)
48 #define ACR_PRFTBE_Mask ((uint32_t)0xFFFFFFEF)
49
50 /* Flash Access Control Register bits */
51 #define ACR_PRFTBS_Mask ((uint32_t)0x00000020)
52
53 /* Flash Control Register bits */
54 #define CR_PG_Set ((uint32_t)0x00000001)
55 #define CR_PG_Reset ((uint32_t)0x00001FFE)
56 #define CR_PER_Set ((uint32_t)0x00000002)
57 #define CR_PER_Reset ((uint32_t)0x00001FFD)
58 #define CR_MER_Set ((uint32_t)0x00000004)
59 #define CR_MER_Reset ((uint32_t)0x00001FFB)
60 #define CR_OPTPG_Set ((uint32_t)0x00000010)
61 #define CR_OPTPG_Reset ((uint32_t)0x00001FEF)
62 #define CR_OPTER_Set ((uint32_t)0x00000020)
63 #define CR_OPTER_Reset ((uint32_t)0x00001FDF)
64 #define CR_STRT_Set ((uint32_t)0x00000040)
65 #define CR_LOCK_Set ((uint32_t)0x00000080)
66
67 /* FLASH Mask */
68 #define RDPRT_Mask ((uint32_t)0x00000002)
69 #define WRP0_Mask ((uint32_t)0x000000FF)
70 #define WRP1_Mask ((uint32_t)0x0000FF00)
71 #define WRP2_Mask ((uint32_t)0x00FF0000)
72 #define WRP3_Mask ((uint32_t)0xFF000000)
73 #define OB_USER_BFB2 ((uint16_t)0x0008)
74
75 /* FLASH Keys */
76 #define RDP_Key ((uint16_t)0x00A5)
77 #define FLASH_KEY1 ((uint32_t)0x45670123)
78 #define FLASH_KEY2 ((uint32_t)0xCDEF89AB)
79
80 /* FLASH BANK address */
81 #define FLASH_BANK1_END_ADDRESS ((uint32_t)0x807FFFF)
82
83 /* Delay definition */
84 #define EraseTimeout ((uint32_t)0x000B0000)
85 #define ProgramTimeout ((uint32_t)0x00002000)
86 /**
87 * @}
88 */
89
90 /** @defgroup FLASH_Private_Macros
91 * @{
92 */
93
94 /**
95 * @}
96 */
97
98 /** @defgroup FLASH_Private_Variables
99 * @{
100 */
101
102 /**
103 * @}
104 */
105
106 /** @defgroup FLASH_Private_FunctionPrototypes
107 * @{
108 */
109
110 /**
111 * @}
112 */
113
114 /** @defgroup FLASH_Private_Functions
115 * @{
116 */
117
118 /**
119 @code
120
121 This driver provides functions to configure and program the Flash memory of all STM32F10x devices,
122 including the latest STM32F10x_XL density devices.
123
124 STM32F10x_XL devices feature up to 1 Mbyte with dual bank architecture for read-while-write (RWW) capability:
125 - bank1: fixed size of 512 Kbytes (256 pages of 2Kbytes each)
126 - bank2: up to 512 Kbytes (up to 256 pages of 2Kbytes each)
127 While other STM32F10x devices features only one bank with memory up to 512 Kbytes.
128
129 In version V3.3.0, some functions were updated and new ones were added to support
130 STM32F10x_XL devices. Thus some functions manages all devices, while other are
131 dedicated for XL devices only.
132
133 The table below presents the list of available functions depending on the used STM32F10x devices.
134
135 ***************************************************
136 * Legacy functions used for all STM32F10x devices *
137 ***************************************************
138 +----------------------------------------------------------------------------------------------------------------------------------+
139 | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments |
140 | | devices | devices | |
141 |----------------------------------------------------------------------------------------------------------------------------------|
142 |FLASH_SetLatency | Yes | Yes | No change |
143 |----------------------------------------------------------------------------------------------------------------------------------|
144 |FLASH_HalfCycleAccessCmd | Yes | Yes | No change |
145 |----------------------------------------------------------------------------------------------------------------------------------|
146 |FLASH_PrefetchBufferCmd | Yes | Yes | No change |
147 |----------------------------------------------------------------------------------------------------------------------------------|
148 |FLASH_Unlock | Yes | Yes | - For STM32F10X_XL devices: unlock Bank1 and Bank2. |
149 | | | | - For other devices: unlock Bank1 and it is equivalent |
150 | | | | to FLASH_UnlockBank1 function. |
151 |----------------------------------------------------------------------------------------------------------------------------------|
152 |FLASH_Lock | Yes | Yes | - For STM32F10X_XL devices: lock Bank1 and Bank2. |
153 | | | | - For other devices: lock Bank1 and it is equivalent |
154 | | | | to FLASH_LockBank1 function. |
155 |----------------------------------------------------------------------------------------------------------------------------------|
156 |FLASH_ErasePage | Yes | Yes | - For STM32F10x_XL devices: erase a page in Bank1 and Bank2 |
157 | | | | - For other devices: erase a page in Bank1 |
158 |----------------------------------------------------------------------------------------------------------------------------------|
159 |FLASH_EraseAllPages | Yes | Yes | - For STM32F10x_XL devices: erase all pages in Bank1 and Bank2 |
160 | | | | - For other devices: erase all pages in Bank1 |
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -