指尖影子
2022-01-12 13:58
采纳率: 100%
浏览 170

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条回答 默认 最新

相关推荐 更多相似问题