|
走起-----2 }7 K1 b% [0 c* @+ m 之前使用KIEL,一直都是5.00版本,使用起来STM32F系列的都妥妥的,都不知道为什么,在F072上面,遇到了各式各样的问题,先开始也没多想,觉得ST公司提供的文件非常非常的正确,可是在重新安装了KEIL5.10,KEIL5.12时,问题还是不停的出现' ]* e# G9 A8 X) F7 X' V" m 毫不犹豫,把遇到的其中几个分享一下-----首先是STM32PACK文件的问题,KEIL在安装的时候不知道抽了什么风,老是PACKINSTALLER无响应,在IMPORT之后好长时间没反应,一点击就无响应,使用器件就没有保障,遂选择一个类似的,唯一是把其中的固件库文件要修改其中一部分2 D; W8 j" A Z6 y6 {8 s 好比来说,选择FLASH有不同,那就改变FLASH文件,ADC位数不同,那就该调整STM32F0XX_ADC.H; {* I5 m, {- ] X. f, {& X /**& w+ E, R- Q1 e( O ****************************************************************************** * @file stm32f0xx_flash.h" t! M! i5 p9 ]: @* Q" O * @author MCD Application Team8 i+ R# q6 r' u* f5 @ * @version V1.3.0, A. }) y/ G* d- a ] * @date 16-January-2014" v, B2 a1 Z8 l/ }2 W * @brief This file contains all the functions prototypes for the FLASH ( U O$ S( x, g# M" w) ^* y! k * firmware library. ******************************************************************************- N* p5 M- w, D* S5 y# n * @attention$ p" a5 c. l4 ]" I * * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>2 g& @$ C1 `, s+ t6 O */ x2 f2 g- z8 R, s9 \ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License.) l6 Y- Z. o+ F: o0 {. E * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v27 h0 c8 ^+ w2 J9 V; _ * * Unless required by applicable law or agreed to in writing, software * N6 X/ e: U( Q" I * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and- X/ M' W. q9 ` * limitations under the License. *; F/ u: G( j0 ?& B0 T3 Z ****************************************************************************** */% U. t! O- p8 R3 a; ^ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F0XX_FLASH_H #define __STM32F0XX_FLASH_H3 Y- w1 G! Y. i #ifdef __cplusplus# h% l+ R$ r( L4 H$ q. f0 M extern "C" { #endif /* Includes ------------------------------------------------------------------*/2 u) V$ e% a' U) i0 g1 E9 S, M( K6 t #include "stm32f0xx.h" 5 [+ O y" T3 T$ E( | /** @addtogroup STM32F0xx_StdPeriph_Driver * @{6 M5 E b$ e0 w2 G" u$ h. K */, _# a) l0 B* @# w0 ? \ ) k2 T. A" }) j" c5 X; r /** @addtogroup FLASH * @{/ q, P1 g5 Z' u- ] */ # j# C4 f) ]5 L8 w /* Exported types ------------------------------------------------------------*/ /** * @brief FLASH Status */ # e1 h* z: E8 ]0 r- v/ B: k6 k8 d+ i typedef enum { v2 z) J* R* R FLASH_BUSY = 1, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_COMPLETE, F0 \6 Q! M, C& D FLASH_TIMEOUT }FLASH_Status; 4 q9 H+ |. F) A$ j# {8 N+ A /* Exported constants --------------------------------------------------------*/. E# g# c/ x" W$ c: [* h* C 2 u/ R U$ F& s: S /** @defgroup FLASH_Exported_Constants; ~% |' R6 Y( ^- g * @{ */ ' o- ~; t& _; n3 B: p. y0 L: G9 C /** @defgroup FLASH_Latency ) n. K6 ?' H! k' V8 _, G; C; [ * @{8 j% I! ]% J: L5 b4 B2 d/ ^# X7 |. B */ #define FLASH_Latency_0 ((uint32_t)0x00000000) /*!< FLASH Zero Latency cycle */ #define FLASH_Latency_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */* T/ \( `3 E# }% R$ o$ ^! w$ | 0 C" D( A# s+ f" m$ ? #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_Latency_0) || \ ((LATENCY) == FLASH_Latency_1))2 \/ Y5 ?, l* u3 [6 j. c& R /** * @} */ /** @defgroup FLASH_Interrupts 9 p0 H- q1 y) W; t, Q" I2 r5 i * @{- B! d& C7 v+ z */ + C& {7 ]! o( _- Q #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of programming interrupt source */, y- l. ~! ]' z' Q #define FLASH_IT_ERR FLASH_CR_ERRIE /*!< Error interrupt source */ #define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0xFFFFEBFF) == 0x00000000) && (((IT) != 0x00000000))), R/ @; u" i$ O /**" O4 U! w# L8 }( {, Z7 C2 x; @: D8 [ * @}- ?( i1 e: o$ F" t */ #define OB_STOP_NoRST ((uint8_t)0x02) /*!< No reset generated when entering in STOP */. R+ ^- z7 ]6 U #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */ #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NoRST) || ((SOURCE) == OB_STOP_RST))0 d1 p5 m) J4 D0 P 。。。 ' R8 h: f& ?5 B& f /** @defgroup FLASH_Option_Bytes_BOOT0SW * @{ */* s% |; ? @. M$ N( i1 \" Z+ { , Y2 ]) z; a6 `% u7 O1 G9 o+ W D' B2 d #define OB_BOOT0_SW ((uint8_t)0x00) /*!< BOOT0 pin disabled */ #define OB_BOOT0_HW ((uint8_t)0x80) /*!< BOOT0 pin bonded with GPIO */7 r% |+ N; r$ `$ R #define IS_OB_BOOT0SW(BOOT0) (((BOOT0) == OB_BOOT0_SW) || ((BOOT0) == OB_BOOT0_HW))# u- V7 T9 |, f1 ]8 {; p" W ( r6 j7 G% v6 z6 z% U+ C n /** * @} */ /** @defgroup FLASH_Option_Bytes_VDDA_Analog_Monitoring * @{ */' H3 e3 E5 M" n* ^ k2 c #define OB_VDDA_ANALOG_ON ((uint8_t)0x20) /*!< Analog monitoring on VDDA Power source ON */" f& \& g& ?2 ?6 l$ N8 ?; ~ #define OB_VDDA_ANALOG_OFF ((uint8_t)0x00) /*!< Analog monitoring on VDDA Power source OFF */7 o) ~. v# t7 S ^ . _$ B3 d1 B0 Z# o #define IS_OB_VDDA_ANALOG(ANALOG) (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF)) ; F0 M' u' x% V/ s h% n /** * @}, }' y% {7 `* ]5 M' q- y+ l */ : [6 Q; ]4 x7 W) a" |7 F# H) e3 D /** @defgroup FLASH_Option_Bytes_SRAM_Parity_Enable + f( k4 n+ _( J$ l * @{ */1 b$ [, p6 G1 b % A1 l6 |3 x+ p9 q8 c9 `( P #define OB_SRAM_PARITY_SET ((uint8_t)0x00) /*!< SRAM parity enable Set */ #define OB_SRAM_PARITY_RESET ((uint8_t)0x40) /*!< SRAM parity enable reset */2 X( N5 j7 m1 s! Y ! N i$ m) Z# o: v! `- f2 w9 x, w #define IS_OB_SRAM_PARITY(PARITY) (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET))6 T* K( J. D' u' W 5 Z1 D. b* `/ l0 H' e$ S4 a) r /**# o$ D* ]) P" v6 b$ v& L/ D * @} */ /** @defgroup FLASH_Flags * @{ */ % U- R8 L/ p* w! V5 U( R9 F0 K #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */+ [% M( d+ x; u3 | #define FLASH_FLAG_PGERR FLASH_SR_PGERR /*!< FLASH Programming error flag */3 l; j( c7 p- B- K8 x #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */$ H- L/ m0 ]- l, J- \% b #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Programming flag */, f5 J8 l2 Z" S3 O3 B4 @6 T 1 l4 H) u* F- u0 n0 I9 c: v #define IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFCB) == 0x00000000) && ((FLAG) != 0x00000000)) #define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_PGERR) || \/ Q2 N5 L8 o7 f+ ]! J O ((FLAG) == FLASH_FLAG_WRPERR) || ((FLAG) == FLASH_FLAG_EOP))* Q4 H3 y$ S b4 t) C) _' K8 `' v1 X # N9 \# D8 f. i r" Q #ifdef __cplusplus' H: q2 ]% I+ z7 j" a }# F+ D6 O1 J, e7 T; X #endif #endif ; e. s0 U/ F& A; G1 P9 {2 Q5 r 就是这个方法,就可以了- E! K% k) O% Z) @7 u/ t KEIL,IAR使用非常多,虽然见识了mbed的许多优点,但是我觉得还是喜欢使用KEIL,不知道大家觉得怎么样,欢迎讨论 |
| 不错哦,谢谢楼主 |
微信公众号
手机版