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

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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵