KEIL编译STM32官方库报错error:  #5: cannot open source input file "core_cm0.h": No such file or directory

从官方下载的外设库,编译时报错:

..\..\..\Libraries\CMSIS\Device\ST\STM32F0xx\Include\stm32f0xx.h(479): error:  #5: cannot open source input file "core_cm0.h": No such file or directory

原因:所使用的MDK版本太新了,比如我用的是MDK5.25.3.0,它们不会从MDK安装目录去查找头文件。 所以导致这个错误。

解决办法:

方法1:

core_cm0.h这个头文件一般在官方库目录 STM32F0xx standard peripherals library\STM32F0xx_StdPeriph_Lib_V1.5.0\Libraries\CMSIS\Include文件夹里面,在Options for target-C/C++-include path里面加入这个文件夹即可。

方法2:

将官方库目录 STM32F0xx standard peripherals library\STM32F0xx_StdPeriph_Lib_V1.5.0\Libraries\CMSIS\Include文件夹里面的文件复制到keil软件安装的include目录下

C:\Keil_v5\ARM\Pack\Keil\STM32F0xx_DFP\1.2.0\Device\Include

  • 8
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Version: 2.15.0 (2020-09-28) Keil.STM32F4xx_DFP.2.15.0.pack Download Updated Pack to STM32Cube_FW_F4 Firmware Package version V1.25.1 using HAL Drivers V1.7.9. STM32CubeMX integration (Version 6.0.1): Added support for Timebase Source TIMx (FrameworkCubeMX_gpdsc.ftl). Removed non-existent include path. CMSIS Flash Algorithm: Corrected STM32F42xxx_43xxx_OPT Algorithm. CMSIS SVD: Updated STM32F42*.svd, STM32F43*.svd files. CMSIS-Driver: I2C: Corrected 2 byte reception in master mode. MCI: Replaced empty delay loops with _NOP(). SPI: Corrected PowerControl function (to return error if Initialize was not called, to abort active transfer if power off was requested). Updated GetDataCount function to give accurate count in DMA mode. Corrected Control function (abort in DMA mode, software controlled slave select in slave mode, TI Frame Format selection, ignore bus speed for slave mode). Corrected Uninitialize function (to power off the peripheral if it is powered). Corrected SPI3_SCK pin configuration. Corrected DMA MemDataAlignment configuration. USART: Corrected DMA MemDataAlignment configuration. USBD_HS/USBH_HS: OTG_HS ULPI clock disabled in low power if internal PHY is used to enable proper operation of OTG_HS port in FS mode during CPU sleep. CAN/EMAC/USBD/USBH: Removed macros already provided by cmsis_compiler.h. Updated Boards Examples: Migrated CubeMX projects to V6.0.1 and updated config files. Changed variant selection to "MDK-Plus" where possible. Updated all USB Host/Device examples with user templates from MDK-Middleware v7.11.1. Terminating app_main thread with osThreadExit() to avoid endless loop Updated MS Windows UBS driver files.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值