將 IAR 5.5 專案遷移至 IAR 6.3 編譯時,報錯:
Error[Pe147]: declaration is incompatible with "__interwork __softfp unsigned long __get_PSP(void)" (declared at line 52 of "core_cm3.h")
原因是 CMSIS 核心文件版本不匹配,舊專案包含的 core_cm3.h 與新版 IAR 內建 CMSIS 定義衝突。
啟用內建 CMSIS 庫
$PROJ_DIR$\..\..\..\Libraries\CMSIS\CM3\CoreSupport 的路徑。
移除舊 CMSIS 包含路徑後的設置
重新編譯,錯誤消失,輸出 Compile OK。
編譯成功
__get_PSP 等內聯函數簽名已調整(加入 __interwork __softfp 屬性)。core_cm3.h 導致重複聲明衝突。stm32f10x.h),確保其包含路徑正確且版本匹配。