IAR版本不相容導致無法正常開啟工程檔案--解決方法
嵌入式開發/學習過程中,難免需要借鑑別人的工程,但是開發環境的匹配始終是個問題==版本不匹配—無法正常的開啟工程檔案。
一般官方標配的開發環境包括:
- MDK
- IAR
這裡描述IAR環境下,如何解決版本相容問題。
IAR版本引起的提示訊息:
broken options:
unknown tool:
開啟工程後的一堆messages:
LOAD: Configuration ‘FLASH_512KB’ in the project ‘ceac-k60-adc’ contains broken options for tool ‘ICCARM’:
(Registry: unknown name: CCOptimizationNoSizeConstraints)
Options for ‘ICCARM’ will be set to default.
Creating backup of original project file.
LOAD: Configuration ‘FLASH_512KB’ in the project ‘ceac-k60-adc’ contains broken options for tool ‘C-SPY’:
The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench.
Diagnostics: ‘Settings ‘C-SPY’: unsupported version - ’.
Options for ‘C-SPY’ will be set to default.
LOAD: Configuration ‘FLASH_512KB’ in the project ‘ceac-k60-adc’ contains broken options for tool ‘JLINK_ID’:
The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench.
Diagnostics: ‘Settings ‘JLINK_ID’: unsupported version - ’.
Options for ‘JLINK_ID’ will be set to default.
LOAD: Configuration ‘FLASH_512KB’ in the project ‘ceac-k60-adc’ contains broken options for tool ‘PEMICRO_ID’:
The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench.
Diagnostics: ‘Settings ‘PEMICRO_ID’: unsupported version - ’.
Options for ‘PEMICRO_ID’ will be set to default.
LOAD: Configuration ‘FLASH_512KB’ in the project ‘ceac-k60-adc’ contains broken options for tool ‘XDS100_ID’:
The format of this file is not supported by this version of the workbench. It appears to have been written by a newer version of the workbench.
Diagnostics: ‘Settings ‘XDS100_ID’: unsupported version - ’.
Options for ‘XDS100_ID’ will be set to default.
IAR工程檔案描述檔案解析:
IAR工程所有的配置都採用的指令碼的方式進行描述,
描述工程的三個檔案:
- IAP.eww–IAR EWARM工作區檔案,描述工作區中包含那些project;
- IAP.ewp–C-SPY偵錯程式專案設定檔案;
- IAP.ewd–IAR EWARM專案檔案,有關專案的配置資訊全在裡面;
這裡關注IAP.ewp檔案,指令碼結構是這樣子(使用Notepad++文字編輯器):
找到ICCARM關鍵字的setting段,此為IAR開發環境相關的。
檢視IAR版本:
如何檢視找到的 IAR工程檔案版本?
如下圖:
正常來說這樣子可以看到上次工程被儲存時的IAR版本,但實測並沒有什麼卵用(手動改了便是改了,不更新==不完全可信)。
使IAR版本相容的解決方案:
不相容的表現:
一堆告警+error,開啟options 關注下邊圖示的內容:
那麼,怎麼恢復吶?
晶片型號選擇:
工程內的巨集定義:
檔案路徑包含:
去掉每次開啟工程的異常提示:
至此,版本相容的事兒,完全解決,,,
附:core_m3.c相關的
對於IAR 6.5以後的版本,由於IAR開始集成了CORTEX-M3的C檔案,因此可以會跟st官方的core_m3.c衝突,解決的辦法就是移除官方的該檔案,然後在iar的庫定義裡面新增cm3庫。
可能的設定選項在這裡:
如使用IAR環境自帶的核心檔案,勾選上它。