移植STM32F051,编译后遇到 #error Please select first the target STM32F0xx device used in your applicatio
生活随笔
收集整理的這篇文章主要介紹了
移植STM32F051,编译后遇到 #error Please select first the target STM32F0xx device used in your applicatio
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
@TOC
解釋一下這句報錯的意思:錯誤“請首先選擇應用程序中使用的目標STM32F0xx設備"
因為庫文件是N多個型號共用的,所以在編譯之前必須選擇一個芯片型號。之后才能編譯。
編譯報錯如下
.\Libraries\CMSIS\Device\ST\STM32F0xx\Include\stm32f0xx.h(111): error: #35: #error directive: “Please select first the target STM32F0xx device used in your application (in stm32f0xx.h file)”
解決辦法
我們雙擊報錯的位置,進入到錯誤位置。
我這個選用的是STM32F051芯片,所以找到有關051的地方,這里是提示如果定義了STM32F0XX_MD,STM32F051才會被定義。
把STM32F0XX_MD復制下來,打開KEIL MDK的工程選項。
在C/C++對話框 Define 增加STM32F0XX_MD然后再編譯一次。編譯通過。
總結
以上是生活随笔為你收集整理的移植STM32F051,编译后遇到 #error Please select first the target STM32F0xx device used in your applicatio的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: leetcode 1386.安排电影院座
- 下一篇: 2d有限元计算机仿真,平面铣削加工过程计