keil編譯出錯
阿新 • • 發佈:2019-01-08
keil出錯
按照工程檔案建立工程後,編譯keil出現很多錯誤。
在.c檔案中沒有stm32f10x_conf.h檔案,原因是缺少預處理指令.
此時加入USE_STDPERIPH_DRIVER, STM32F10X_MD即可解決錯誤。注意:此時要按照自己的晶片選擇(LD,MD,HD,)
這是在stm32f10x.h中定義了
95 #if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL) 96 #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" 97 #endif 8296 #ifdef USE_STDPERIPH_DRIVER 8297 #include "stm32f10x_conf.h" 8298 #endif
keil 快捷鍵
F7 建立工程
ctrl+F2 設定標記 F2 ,shift+F2 標記變化
ctrl+F5 debug F5執行 F9插入中斷