|
走起----- 之前使用KIEL,一直都是5.00版本,使用起来STM32F系列的都妥妥的,都不知道为什么,在F072上面,遇到了各式各样的问题,先开始也没多想,觉得ST公司提供的文件非常非常的正确,可是在重新安装了KEIL5.10,KEIL5.12时,问题还是不停的出现: @* X" W" s( o. i6 Z; P2 h 毫不犹豫,把遇到的其中几个分享一下-----首先是STM32PACK文件的问题,KEIL在安装的时候不知道抽了什么风,老是PACKINSTALLER无响应,在IMPORT之后好长时间没反应,一点击就无响应,使用器件就没有保障,遂选择一个类似的,唯一是把其中的固件库文件要修改其中一部分' E1 b8 x9 u M! r1 h8 H 好比来说,选择FLASH有不同,那就改变FLASH文件,ADC位数不同,那就该调整STM32F0XX_ADC.H /** ******************************************************************************3 Q2 p9 X9 r: ~, s * @file stm32f0xx_flash.h7 s: B; [3 `# E j0 @* G * @author MCD Application Team m" W6 Q4 `( }3 w$ T! G * @version V1.3.0: P' {1 ]0 M& k7 k, N1 W * @date 16-January-2014; G" F4 |" R3 k5 o2 n) w2 m * @brief This file contains all the functions prototypes for the FLASH . }2 F' t) D& n * firmware library. ******************************************************************************( u$ m5 E- |5 @ * @attention *: ~/ S+ Q" B4 P9 X) Y& n @) }& {0 F# c * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>7 U) M# Z* V. X+ k6 O * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License.5 M( {9 n9 `$ | ` * You may obtain a copy of the License at: *; z1 }# T/ w! q. n3 U7 | * http://www.st.com/software_license_agreement_liberty_v2" ?2 \2 s& k% g; M * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, % s5 i; p- c; T, D Z8 n! J: h. k * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */& i' U! t, ^# V" B/ w /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F0XX_FLASH_H9 {- D' A7 e( Z3 L+ C" J #define __STM32F0XX_FLASH_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f0xx.h" /** @addtogroup STM32F0xx_StdPeriph_Driver5 J' i7 m, ]4 h* Y6 V1 p3 M * @{ */ /** @addtogroup FLASH * @{ */ % C( {3 v+ S z' u0 O/ Y7 N /* Exported types ------------------------------------------------------------*/ /** % {5 @# c' M% |+ O! y" a. E * @brief FLASH Status1 A* e* O8 K, y8 S */ & K ]% h' o' `6 M1 o1 v4 } typedef enum( m' S7 o- e7 u, k {# j2 {0 ]$ |- I: |6 h0 I7 p6 k FLASH_BUSY = 1,/ c* d) r' X+ {; n+ h P FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM,8 v+ I) N- V( T# Q. L) f5 O1 O& y FLASH_COMPLETE,9 Y q4 \2 M. \! j. ~ FLASH_TIMEOUT }FLASH_Status;- {/ D, Q4 ^0 M& z8 a h /* Exported constants --------------------------------------------------------*/ /** @defgroup FLASH_Exported_Constants: P$ O: T" x- |$ A1 W * @{ */ 2 J4 _6 D; q: f5 X6 i& k - t$ a! a$ A5 N: q$ m' Y /** @defgroup FLASH_Latency * @{3 @1 l, ?! y8 J */ 5 P: \; P F4 w5 q, {) v #define FLASH_Latency_0 ((uint32_t)0x00000000) /*!< FLASH Zero Latency cycle */) r7 u+ Y* t( k5 j& N #define FLASH_Latency_1 FLASH_ACR_LATENCY /*!< FLASH One Latency cycle */) ]2 K: U' u" o6 c7 n/ i ?- s s . M D4 z0 B! r% Y' g" M/ C! e #define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_Latency_0) || \/ x8 r5 T* I: Q' Q; E; g3 m- ]$ ~ ((LATENCY) == FLASH_Latency_1)) /**. U& d# @1 n" o7 \) s2 V6 y * @} */ , O' J7 [! [; s! @* |* l" D7 o% S, f /** @defgroup FLASH_Interrupts * @{ */ #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of programming interrupt source */. s' Q% a$ x3 g! {' p #define FLASH_IT_ERR FLASH_CR_ERRIE /*!< Error interrupt source */ #define IS_FLASH_IT(IT) ((((IT) & (uint32_t)0xFFFFEBFF) == 0x00000000) && (((IT) != 0x00000000)))& m, g+ ^+ F+ N$ e. ~9 l8 S) W2 E /**" Z( S4 F2 Y* O: s" E+ m3 w; X * @} */ 7 A# G* l7 E( d; c1 j! ^: O5 K + j7 [9 Z( t5 Z8 u ; Q3 I [) S+ B2 y4 t #define OB_STOP_NoRST ((uint8_t)0x02) /*!< No reset generated when entering in STOP */ #define OB_STOP_RST ((uint8_t)0x00) /*!< Reset generated when entering in STOP */1 ^& ]0 o, }2 \' L, q5 v #define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NoRST) || ((SOURCE) == OB_STOP_RST)) 。。。 /** @defgroup FLASH_Option_Bytes_BOOT0SW* ^4 G1 x9 S. ~6 m- A! U1 H* l * @{# k3 d% T1 D4 x% ` */ & i& T& a u- ^) c6 [$ Q' a/ X #define OB_BOOT0_SW ((uint8_t)0x00) /*!< BOOT0 pin disabled */ $ z3 D# p4 p! J7 |; K1 ]6 n' ?5 B0 J #define OB_BOOT0_HW ((uint8_t)0x80) /*!< BOOT0 pin bonded with GPIO */$ u0 k7 |/ ]) k: `6 P #define IS_OB_BOOT0SW(BOOT0) (((BOOT0) == OB_BOOT0_SW) || ((BOOT0) == OB_BOOT0_HW)) /**6 }8 e% Q+ N( H * @} */ $ m/ W" T* _% x! n5 u, J- ?* I& t /** @defgroup FLASH_Option_Bytes_VDDA_Analog_Monitoring * @{ */ . }2 V7 X) [; ]0 u #define OB_VDDA_ANALOG_ON ((uint8_t)0x20) /*!< Analog monitoring on VDDA Power source ON */ #define OB_VDDA_ANALOG_OFF ((uint8_t)0x00) /*!< Analog monitoring on VDDA Power source OFF */9 k/ h. {8 Y/ Y) y) P! U( p: R ) f1 S( v. G* r$ l/ {$ v! [* C1 X2 r #define IS_OB_VDDA_ANALOG(ANALOG) (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF)) ( ?8 ~1 l# l% x o, ^; g: E /**& R- d1 K7 u$ H* T- V+ V3 k * @} */ 7 U9 t# z% z, k/ x* ^ ) X+ o, n0 j- u; \: a /** @defgroup FLASH_Option_Bytes_SRAM_Parity_Enable ; X9 Q+ m. U" Y) o * @{$ s/ y# J% b) m) M7 ? */ , ?1 q, F' P; f) ~ #define OB_SRAM_PARITY_SET ((uint8_t)0x00) /*!< SRAM parity enable Set */ #define OB_SRAM_PARITY_RESET ((uint8_t)0x40) /*!< SRAM parity enable reset */ - r1 I0 n& p" i5 H% G+ ]" N$ Y #define IS_OB_SRAM_PARITY(PARITY) (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET)) ! e6 e9 r7 z1 M /** * @}: T4 s3 Z& z4 }7 h */ 0 P# N) Y; C; Q; a" v( ] - G1 z+ h" ]' i5 R$ K4 B. x } /** @defgroup FLASH_Flags * @{ */ #define FLASH_FLAG_BSY FLASH_SR_BSY /*!< FLASH Busy flag */ #define FLASH_FLAG_PGERR FLASH_SR_PGERR /*!< FLASH Programming error flag */ #define FLASH_FLAG_WRPERR FLASH_SR_WRPERR /*!< FLASH Write protected error flag */ #define FLASH_FLAG_EOP FLASH_SR_EOP /*!< FLASH End of Programming flag */ * \! |' e! G$ N8 e #define IS_FLASH_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFCB) == 0x00000000) && ((FLAG) != 0x00000000))+ w4 E, K1 h. X6 B, f9 G/ F, m) ~ #define IS_FLASH_GET_FLAG(FLAG) (((FLAG) == FLASH_FLAG_BSY) || ((FLAG) == FLASH_FLAG_PGERR) || \ h" [6 O, v7 g1 Q B$ i/ r ((FLAG) == FLASH_FLAG_WRPERR) || ((FLAG) == FLASH_FLAG_EOP)) + E6 i$ ^2 d+ R: s& L #ifdef __cplusplus }% ]5 A K9 R2 s! Y j* t' _ #endif3 F6 V* S R' Y2 s #endif # R6 l x Z% T y/ q# k/ [9 l 就是这个方法,就可以了7 p. u6 M" [4 n0 o& g7 q KEIL,IAR使用非常多,虽然见识了mbed的许多优点,但是我觉得还是喜欢使用KEIL,不知道大家觉得怎么样,欢迎讨论 |
| 不错哦,谢谢楼主 |
微信公众号
手机版