STM32F407用STM32 Cube Mx 生成工程文件报错../Core/Inc/stm32f4xx_hal_conf.h(282): error: #5: cannot open sourc

STM32F407用STM32 Cube Mx 生成工程文件报错,提示找不到 stm32f4xx_hal_exti.h 文件。

CubeMx版本 6.2.0 ,

HAL库版本    STM32Cube_FW_F4_V1.19.0、STM32Cube_FW_F4_V1.21.0、STM32Cube_FW_F4_V1.26.1

报错原因:STM32 Cube Mx是新版的,生成的hal_confg.h里面带了#include stm32f1xx_hal_exti.h但是RTT里面的是库不是最新的,里面没有这个文件,所以就报错了。解决办法:自行添加该文件到工程目录下或是将HAL库更新至最新版本即可。使用STM32Cube_FW_F4_V1.19.0以及STM32Cube_FW_F4_V1.21.0均相同错误,更新至STM32Cube_FW_F4_V1.26.1版本的库后编译通过。

Build target 'leds
assembling startup_stm32f407xx.s...
compiling stm32f4xx_hal_tim.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c: 0 warnings, 1 error
compiling stm32f4xx_it.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Core/Src/stm32f4xx_it.c: 0 warnings, 1 error
compiling stm32f4xx_hal_flash_ex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c: 0 warnings, 1 error
compiling stm32f4xx_hal_gpio.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c: 0 warnings, 1 error
compiling stm32f4xx_hal_rcc.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c: 0 warnings, 1 error
compiling stm32f4xx_hal_tim_ex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c: 0 warnings, 1 error
compiling stm32f4xx_hal_flash.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c: 0 warnings, 1 error
compiling stm32f4xx_hal_rcc_ex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c: 0 warnings, 1 error
compiling stm32f4xx_hal_flash_ramfunc.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c: 0 warnings, 1 error
compiling stm32f4xx_hal_msp.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Core/Src/stm32f4xx_hal_msp.c: 0 warnings, 1 error
compiling gpio.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Core/Src/gpio.c: 0 warnings, 1 error
compiling stm32f4xx_hal_exti.c...
"no source": Error:  #5: cannot open source input file "../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c": No such file or directory
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c: 0 warnings, 1 error
compiling main.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Core/Src/main.c: 0 warnings, 1 error
compiling stm32f4xx_hal_dma_ex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c: 0 warnings, 1 error
compiling stm32f4xx_hal_cortex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c: 0 warnings, 1 error
compiling stm32f4xx_hal.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c: 0 warnings, 1 error
compiling stm32f4xx_hal_pwr_ex.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c: 0 warnings, 1 error
compiling system_stm32f4xx.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Core/Src/system_stm32f4xx.c: 0 warnings, 1 error
compiling stm32f4xx_hal_dma.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c: 0 warnings, 1 error
compiling stm32f4xx_hal_pwr.c...
../Core/Inc/stm32f4xx_hal_conf.h(282): error:  #5: cannot open source input file "stm32f4xx_hal_exti.h": No such file or directory
    #include "stm32f4xx_hal_exti.h"
../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c: 0 warnings, 1 error
"leds\leds.axf" - 20 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:14

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值