在用 Keil 進行 STM32 開發的時候,一開始下載,下載的 ARM 編譯器是 Version6,他就不兼容老的代碼,就很抽象。
所以必須要更換編譯器。
可以去官網下載編譯器?Downloads - Arm Developer?,也可以自己找資源哈(百度網盤 請輸入提取碼)
那編譯器下載好后,要注意安裝的地址,一定要在keil5安裝的 ARM 目錄下,不然會報License錯誤。
例如:
ARMLMD_LICENSE_FILE is not set. You must set this to the path to your license.
Information about this error is available at: http://ds.arm.com/support/lic87/m1General licensing information is available at: http://ds.arm.com/support/licensing/If you need further help, provide this complete error report to your supplier or license.support@arm.com.- ARMLMD_LICENSE_FILE: unset- LM_LICENSE_FILE: unset- ARM_TOOL_VARIANT: unset- ARM_PRODUCT_PATH: unset- Product location: C:\soft\arm-compiler-Version5\sw\mappings- Toolchain location: C:\soft\arm-compiler-Version5\Bin- Selected tool variant: product- Checkout feature: compiler5- Feature version: 5.0202006- Flex error code: -1
Product: ARM Compiler 5.06
Component: ARM Compiler 5.06 update 7 (build 960)
Tool: ArmCC [4d365d]
".\Objects\Project.axf" - 28 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01
后面就是添加編譯器了
選擇安裝的編譯器version5的地址就好了。