?以上為錯(cuò)誤截圖,一下為錯(cuò)誤信息
Start/core_cm3.c(445): error: non-ASM statement in naked function is not supported
? uint32_t result=0;
? ^
Start/core_cm3.c(442): note: attribute is here
uint32_t __get_PSP(void) __attribute__( ( naked ) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
Start/core_cm3.c(465): error: parameter references not allowed in naked functions
? ? ? ? ? ? ? ? ? "BX ?lr ? ? \n\t" : : "r" (topOfProcStack) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
Start/core_cm3.c(461): note: attribute is here
void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
Start/core_cm3.c(479): error: non-ASM statement in naked function is not supported
? uint32_t result=0;
? ^
Start/core_cm3.c(476): note: attribute is here
uint32_t __get_MSP(void) __attribute__( ( naked ) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^
Start/core_cm3.c(499): error: parameter references not allowed in naked functions
? ? ? ? ? ? ? ? ? "BX ?lr ? ? \n\t" : : "r" (topOfMainStack) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
Start/core_cm3.c(495): note: attribute is here
void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) );
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
4 errors generated.
compiling core_cm3.c...
compiling system_stm32f10x.c...
compiling stm32f10x_tim.c...
".\Objects\stm32.axf" - 4 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: ?00:00:02
解決方法:是因?yàn)閗eil5.38使用了6的編譯器,網(wǎng)上大多數(shù)都是切換到5編譯器,我的辦法是將core_cm3.h、core_cm3.c文件替換成新的core_cm3.h文件,將core_cm3.c刪除。同時(shí)在當(dāng)前目錄下添加一下文件。
以下為報(bào)錯(cuò)前的start目錄
替換后的start目錄為:
?替換以后可以看到,編譯已經(jīng)成功了
我將以上四個(gè)文件打包到百度網(wǎng)盤,需要的自?。?mark hidden color="red">文章來源:http://www.zghlxwxcb.cn/news/detail-515426.html
鏈接: https://pan.baidu.com/s/1jTSXPVFOwuZB5noyv31T0A?pwd=kq7r 提取碼: kq7r 復(fù)制這段內(nèi)容后打開百度網(wǎng)盤手機(jī)App,操作更方便哦文章來源地址http://www.zghlxwxcb.cn/news/detail-515426.html
到了這里,關(guān)于解決keil5.38編譯stm32報(bào)四個(gè)錯(cuò)誤問題,無需更換ARM5編譯器的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!