转载和补偿 keil5编译工程常见问题汇总
我们在编译keil工程的时候总是遇到很多问题,我把一些常见的问题和解决方案汇总下来,仅供大家参考。
问题汇总
问题1
问题描述
选择arm v6版本编译器,编译keil5工程,报错;core_cm3.c出现4处报错,具体内容如下:
Build started: Project: stm32f10x_Project_Template
*** Using Compiler ‘V6.14’, folder: ‘E:\Keil\ARM\ARMCLANG\Bin’
Build target ‘Template’
CMSIS/core_cm3.c(445): error: non-ASM statement in naked function is not supported
uint32_t result=0;
^
CMSIS/core_cm3.c(442): note: attribute is here
uint32_t __get_PSP(void) attribute( ( naked ) );
^
CMSIS/core_cm3.c(465): error: parameter references not allowed in naked functions
“BX lr \n\t” : : “r” (topOfProcStack) );
^
CMSIS/core_cm3.c(461): note: attribute is here
void __set_PSP(uint32_t topOfProcStack) attribute( ( naked ) );
^
CMSIS/core_cm3.c(479): error: non-ASM statement in naked function is not supported
uint32_t result=0;
^
CMSIS/core_cm3.c(476): note: attribute is here
uint32_t __get_MSP(void) attribute( ( naked ) );
^
CMSIS/core_cm3.c(499): error: parameter references not allowed in naked functions
“BX lr \n\t” : : “r” (topOfMainStack) );
^
CMSIS/core_cm3.c(495): note: attribute is here
void __set_MSP(uint32_t topOfMainStack) attribute( ( naked )