V5.06 update 6 (build750)编译器获取路径以放置在文末


出现该错误的原因

出现该错误的原因是STM32的标准库版本与当前的ARM编译器版本不匹配导致的,因此需要选择其他的编译器。

情况比如:你安装的Keil5 MDK5.39,此时的编译器中应为图中框选的三个ARM编译器。

但是在比如江协科技的STM32标准库教程中的工程文件中,使用这三个编译器是不能正常编译的。会出现如下报错
use defult compiler version6

Start/core_cm3.c(445): error: non-ASM statement in naked function is not supported
  445 |   uint32_t result=0;
      |   ^
Start/core_cm3.c(442): note: attribute is here
  442 | uint32_t __get_PSP(void) __attribute__( ( naked ) );
      |                                           ^
Start/core_cm3.c(465): error: parameter references not allowed in naked functions
  465 |                   "BX  lr     \n\t" : : "r" (topOfProcStack) );
      |                                              ^
Start/core_cm3.c(461): note: attribute is here
  461 | void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) );
      |                                                          ^
Start/core_cm3.c(479): error: non-ASM statement in naked function is not supported
  479 |   uint32_t result=0;
      |   ^
Start/core_cm3.c(476): note: attribute is here
  476 | uint32_t __get_MSP(void) __attribute__( ( naked ) );
      |                                           ^
Start/core_cm3.c(499): error: parameter references not allowed in naked functions
  499 |                   "BX  lr     \n\t" : : "r" (topOfMainStack) );
      |                                              ^
Start/core_cm3.c(495): note: attribute is here
  495 | void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) );
      |                                                          ^
4 errors generated.

解决办法

解决办法,向keil中添加5.3X之前的编译器,比如V5.06 update 6 (build750)

添加方法:

确定完即可,后回到魔术棒切换编译器,若没有刷新,就重启一下keil。找到V5.06 update 6 (build750)。
 

编译器获取链接:

1. 官方页面下载:

Legacy Arm Compilers – Arm Developer

2.个人仓库下载

https://gitcode.com/Amireux_T/keilcomplier_ARMCC.git

 

 

Logo

智能硬件社区聚焦AI智能硬件技术生态,汇聚嵌入式AI、物联网硬件开发者,打造交流分享平台,同步全国赛事资讯、开展 OPC 核心人才招募,助力技术落地与开发者成长。

更多推荐