指尖影子 2022-01-12 13:58 采纳率: 100%
浏览 681
已结题

STM32使用Keil5编译程序出错,确认自己编的程序没问题,编译就有问题

STM32使用Keil5编译程序出错,确认自己编的程序没问题,编译就有问题,报错如下:


Rebuild started: Project: Project
*** Using Compiler 'V6.16', folder: 'D:\Keil_v5\ARM\ARMCLANG\Bin'
Rebuild target 'Target 1'
compiling stm32f10x_crc.c...
compiling misc.c...
compiling stm32f10x_bkp.c...
compiling stm32f10x_dbgmcu.c...
compiling stm32f10x_cec.c...
compiling stm32f10x_dac.c...
compiling stm32f10x_adc.c...
compiling stm32f10x_can.c...
compiling stm32f10x_exti.c...
compiling stm32f10x_dma.c...
compiling stm32f10x_fsmc.c...
compiling stm32f10x_gpio.c...
compiling stm32f10x_iwdg.c...
compiling stm32f10x_flash.c...
compiling stm32f10x_i2c.c...
compiling stm32f10x_pwr.c...
compiling stm32f10x_rtc.c...
compiling stm32f10x_rcc.c...
compiling stm32f10x_sdio.c...
CORE/core_cm3.c(445): error: non-ASM statement in naked function is not supported
  uint32_t result=0;
  ^
CORE/core_cm3.c(442): note: attribute is here
uint32_t __get_PSP(void) __attribute__( ( naked ) );
                                          ^
CORE/core_cm3.c(465): error: parameter references not allowed in naked functions
                  "BX  lr     \n\t" : : "r" (topOfProcStack) );
                                             ^
CORE/core_cm3.c(461): note: attribute is here
void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) );
                                                         ^
CORE/core_cm3.c(479): error: non-ASM statement in naked function is not supported
  uint32_t result=0;
  ^
CORE/core_cm3.c(476): note: attribute is here
uint32_t __get_MSP(void) __attribute__( ( naked ) );
                                          ^
CORE/core_cm3.c(499): error: parameter references not allowed in naked functions
                  "BX  lr     \n\t" : : "r" (topOfMainStack) );
                                             ^
CORE/core_cm3.c(495): note: attribute is here
void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) );
                                                         ^
4 errors generated.
compiling core_cm3.c...
compiling stm32f10x_wwdg.c...
compiling stm32f10x_spi.c...
compiling stm32f10x_usart.c...
assembling startup_stm32f10x_md.s...
compiling main.c...
compiling stm32f10x_it.c...
compiling stm32f10x_tim.c...
compiling system_stm32f10x.c...
".\Objects\Project.axf" - 4 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:02
  • 写回答

1条回答 默认 最新

  • 嵌入式历练者 嵌入式领域新星创作者 2022-01-12 14:18
    关注

    img


    编译器版本高了,在魔法棒中修改编译器为Use default compiler version5就可以编译通过。

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 1月20日
  • 已采纳回答 1月12日
  • 创建了问题 1月12日

悬赏问题

  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来