使用Keil uvision5新建stm32新建工程时遇到的问题

报错的大致内容是这个

img

看了一下,大致意思是打不开core_cm3.o这个文件,好像是因为选项"-c"的问题,但我不太能理解这是什么意思
希望有人能帮我解决一下

把设置的内容截下图

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 这个问题的回答你可以参考下: https://ask.csdn.net/questions/7679312
  • 除此之外, 这篇博客: STM32F103X开发-01:工程模板建立-keil编译工程后,core_cm3.c出现4处报错中的 问题描述 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:

    STM32F103X开发-01:工程模板建立-keil编译工程后,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 ) );
    ^
    4 errors generated.
    compiling core_cm3.c…
    “.\Objects\stm32f10x_Project_Template.axf” - 4 Error(s), 0 Warning(s).
    Target not created.
    Build Time Elapsed: 00:00:00


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^