1. 程式人生 > >把stm32韌體庫替換過程中出現的問題

把stm32韌體庫替換過程中出現的問題

USE_STDPERIPH_DRIVER, STM32F10X_HD

compiling stm32f10x_usart.c...

.\CMSIS\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:     ^

.\CMSIS\stm32f10x.h: FWlib\src\stm32f10x_usart.c: 0 warnings, 1 error

compiling stm32f10x_wwdg.c...

.\CMSIS\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:     ^

.\CMSIS\stm32f10x.h: FWlib\src\stm32f10x_wwdg.c: 0 warnings, 1 error

compiling SetClock.c...

.\CMSIS\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:    #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"

.\CMSIS\stm32f10x.h:     ^

在這裡新增 USE_STDPERIPH_DRIVER, STM32F10X_HD 問題解決

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                                 C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  s32;

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                        ^

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  const sc32;  /* Read Only */

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  vs32;

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                 ^

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  const vsc32;  /* Read Only */

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                       

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CMSIS\stm32f10x.h")

C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef unsigned long  u32;

#include "stm32f10x.h"    //#include "stm32f10x_lib.h"

stm32f10x.h檔案中新增stm32f10x_conf.h,並且用#include "stm32f10x.h"代替#include "stm32f10x_lib.h",問題解決。

.\FWlib\inc\stm32f10x_adc.h(52): error:  #20: identifier "uint32_t" is undefined

.\FWlib\inc\stm32f10x_adc.h:     uint32_t ADC_Mode;                      /*!< Configures the ADC to operate in independent or

.\FWlib\inc\stm32f10x_adc.h:     ^

.\FWlib\inc\stm32f10x_adc.h(56): error:  #20: identifier "FunctionalState" is undefined

.\FWlib\inc\stm32f10x_adc.h:     FunctionalState ADC_ScanConvMode;       /*!< Specifies whether the conversion is performed in

.\FWlib\inc\stm32f10x_adc.h:     ^

.\FWlib\inc\stm32f10x_adc.h(60): error:  #20: identifier "FunctionalState" is undefined

.\FWlib\inc\stm32f10x_adc.h:     FunctionalState ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in

.\FWlib\inc\stm32f10x_adc.h:     ^

.\FWlib\inc\stm32f10x_adc.h(64): error:  #20: identifier "uint32_t" is undefined

.\FWlib\inc\stm32f10x_adc.h:     uint32_t ADC_ExternalTrigConv;          /*!< Defines the external trigger used to start the analog

.\FWlib\inc\stm32f10x_adc.h:     ^

.\FWlib\inc\stm32f10x_adc.h(68): error:  #20: identifier "uint32_t" is undefined

stm32f10x_conf.h檔案中新增#include <stdint.h > ,上面問題解決。

這類錯誤是 因為stm32函式庫版本 不同引起的,#include "stm32f10x.h"相互替換#include "stm32f10x_lib.h",問題解決。

相關推薦

stm32替換過程出現的問題

USE_STDPERIPH_DRIVER, STM32F10X_HD compiling stm32f10x_usart.c... .\CMSIS\stm32f10x.h(96): error:  #35: #error directive: "Please select first the target

如何新建stm32工程

1、首先先新建一個工程資料夾,在它之下再新建7個資料夾 DOC用於存放程式說明檔案 Listing存放的是編譯器編譯時候產生的c/彙編/連結的列表清單 Output存放的是編譯產生的除錯資訊、hex檔案、預覽資訊、封裝庫等 Project用來存放工程 CMSIS

STM32F429 >> 3. STM32

CMSIS 標準中最主要的為 CMSIS 核心層,它包括了: 核心函式層:其中包含用於訪問核心暫存器的名稱、地址定義; 裝置外設訪問層:提供了片上的核外外設的地址和中斷定義。 庫目錄,檔案簡介 在STM32F4xx_DSP_StdPeriph_Lib_V

GD32 使用stm32

1、 系統     1) 晶振起振區別     描述:啟動時間,GD32 與STM32 啟動時間都是2ms,實際上GD 的執行效率快,所以ST 的HSE_STARTUP_TIMEOUT ((uint16_t)0x0500)是2ms,但是這個巨集定義值在GD 上時間就更

STM32之GPIOx操作理解

   關於使用韌體庫操作GPIO管腳,在配置時,使用了這樣的語句: GPIOx->BRR = GPIO_Pin;   韌體庫相關原始碼: typedef struct {   __IO uint32_t CRL;   __IO uint32_t CRH;   __I

STM32 標準的下載,檔案介紹和工程的建立(綜合)

前言 博文基於ARM Cortex-M3核心的STM32F103ZET6晶片和標準3.5.0庫; 博文介紹標準庫中個資料夾的含義和以及一個簡單工程的建立; 如有不足之處還請博友多多指教; 標準庫的下

Linux下開發stm32(四) | 工程開發

st官方韌體庫是在暫存器操作之上的,但是使用暫存器操作的話,需要注意的地方很多,需要對照參考手冊一個一個賦值,稍有不慎便會出錯,所以韌體庫將外設的初始化封裝成初始化結構體,將外設的操作封裝在函式中,將暫存器賦值的操作都封裝起來,我們只需要呼叫API就可以,這樣一來既提高了開發效率,也減少了程

在git新增遠端過程,寫錯遠端倉庫地址,如何遠端倉庫地址修改回來

本人是一名初學者,若有不當之處敬請指出,非常感謝      相信大家在學習使用git的過程中,會偶爾出現因為git遠端倉庫的地址過長,匯入輸入錯誤,然後又無法修正這種錯誤的情況,特別是在本地倉庫已經有檔案的情況下更是無法使用直接的刪除重建倉庫來解決,因此今天

SQL Server數據安裝過程遇到的問題

出現 安裝 .com benet 計算機 div 端口 分析器 名稱 之前因為項目需求,使用SQL Server 2008R數據庫,在安裝完成之後,登錄的時候遇到點問題 問題是:   在本地進行連接的時候localhost、.等無法直接登錄,必須加上實例名,如localho

oracle數據安裝過程的疑惑—該記錄是本人以前寫在微博上的文章

itl 解壓 遠程 新的 api RF 格式 遠程連接 兩個 轉行IT初學者關於oracle數據庫整理第一次安裝數據庫的時候都是按照操作步驟一步一步進行安裝,並沒有對操作步驟產生過懷疑或者為什麽要這麽進行操作?2017年12月8日再次閱讀安裝操作說明書的時候有了新的理解,所

STM32F407VET6之IAR之ewarm7.80.4工程建立(基於官方1.6版本) 的工程檔案目錄

最後整理結構如下所示,├─cmsis│ startup_stm32f401xx.s│ startup_stm32f40xx.s│ startup_stm32f40_41xxx.s│ startup_stm32f410xx.s│ startup_stm32f411xe.s│ startup_stm32f427x

STM32F407VET6之IAR之ewarm7.80.4工程建立(基於官方1.6版本)

今天把stm32F407的工程之IAR建立完成了,特此記錄下。 下載官方韌體庫,STM32F4xx_DSP_StdPeriph_Lib_V1.6.1,V1.8.0版本的同理。新建以下幾個檔案 src放官方的各個c檔案 inc放官方的各個h檔案,以及使用者的h檔案,這樣可以方便在options裡只需要一個

FSMC_NORSRAMInit( )函式程式碼分析

相關結構體 typedef struct { uint32_t FSMC_Bank; //指定FSMC NOR/SRAM的儲存區 塊一的1~4區 uint32_t FSMC_DataAddressMux; //資料地址匯流排複用位設定

Mysql傳統複製空搭建過程reset slave以及reset slave all對複製的影響

Mysql傳統複製空庫搭建過程中reset slave以及reset slave all對複製的影響 主庫資訊 從庫資訊 操作過程 主庫上操作 從庫上操作 主庫上檢視 解決方法 思路探討

python執行及第三方安裝過程遇到的問題彙總(持續更新。。。)

一:安裝NLTK庫時報錯 問題描述:pip安裝nltk庫時未遇到問題但import匯入的時候報錯“ModuleNotFoundError: No module named 'nltk'”; 解決辦法:嘗試了一些辦法沒有解決,後來直接去PyCharm裡面找nltk庫進行安裝,此時報錯“Attr

STM32F1xx微控制器使用時串列埠列印亂碼的解決辦法

有時STM32F1系列微控制器在配置完串列埠之後進行列印時,會出現列印亂碼的問題,此時有可能是以下幾種情況引起:1. 串列埠工具所選擇的波特率和微控制器設定的波特率不一致,請認真排查波特率問題;2. 串列埠的TX、RX管腳可能接觸或焊接不好,請排查硬體問題;3. 程式中使用的

【關於PyCharm安裝和載入Pyecharts視覺化的方法和安裝過程出現的No Module Named XXX的解決方案】

作者:我是你的眼中花花花郵箱:[email protected] 原始碼安裝 $ git clone https://github.com/pyecharts/pyecharts.git $ cd pyecharts $ pip install -r re

ESP8266 01S 刷AT

       今天經歷了亂碼改變世界的想法,  刷完at韌體庫之後一直亂碼, 亂碼......   後來才發現是flash選錯了 廢話不多說, 直接來下韌體吧,先貼一張esp8266 01s的美圖 刷韌體時 ESP8266

vs2015編譯 jrtp使用過程遇到的一些問題

最近在用Jrtp的庫,這個庫的編譯過程的話請自己百度去好了,或者看他那個文章,我這裡只記錄一些問題。一、編譯過程中的問題:1.在編譯jthread庫的時候,configure完之後顯示 “pthread.h not found”:科學搜尋和本地化搜尋都沒見到有人提解決方法,於

STM8S GPIO設定問題

ST對STM8S系列都有提供韌體庫,而不同的版本自然存在一些不同,版本也一直從V1.0.0升級到目前的V1.1.1。 環境: FWLIB V1.0.1版本,採用STM8SF103 在使用GPIO庫時,一個偶然發現stm8s_gpio.h中的巨集定義是存在問題的。 程式碼定義