I2C

求助stm32cubemx 生成工程后编译出错

我用STM32CUBE 5.2.0生成工程后,用 KEILV5.23.0.0编译,所有的头文件都无法加载。头文件都包含在inc文件夹里了,路径也设置正确。可是所有的头文件都编译出错。*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'I2C'
assembling startup_stm32f103xb.s...
compiling main.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/main.c: 0 warnings, 1 error
compiling gpio.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/gpio.c: 0 warnings, 1 error
compiling i2c.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/i2c.c: 0 warnings, 1 error
compiling stm32f1xx_it.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/stm32f1xx_it.c: 0 warnings, 1 error
compiling stm32f1xx_hal_msp.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/stm32f1xx_hal_msp.c: 0 warnings, 1 error
compiling stm32f1xx_hal_gpio_ex.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c: 0 warnings, 1 error
compiling stm32f1xx_hal_i2c.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c: 0 warnings, 1 error
compiling stm32f1xx_hal_tim.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c: 0 warnings, 1 error
compiling stm32f1xx_hal_tim_ex.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c: 0 warnings, 1 error
compiling stm32f1xx_hal.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c: 0 warnings, 1 error
compiling stm32f1xx_hal_rcc.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c: 0 warnings, 1 error
compiling stm32f1xx_hal_rcc_ex.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c: 0 warnings, 1 error
compiling stm32f1xx_hal_gpio.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c: 0 warnings, 1 error
compiling stm32f1xx_hal_dma.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c: 0 warnings, 1 error
compiling stm32f1xx_hal_cortex.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c: 0 warnings, 1 error
compiling stm32f1xx_hal_pwr.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c: 0 warnings, 1 error
compiling stm32f1xx_hal_flash.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c: 0 warnings, 1 error
compiling stm32f1xx_hal_flash_ex.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c: 0 warnings, 1 error
compiling stm32f1xx_hal_exti.c...
"no source": Error:  #5: cannot open source input file "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c": No such file or directory
../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c: 0 warnings, 1 error
compiling system_stm32f1xx.c...
..\Inc\stm32f1xx_hal_conf.h(246): error:  #5: cannot open source input file "stm32f1xx_hal_exti.h": No such file or directory
  #include "stm32f1xx_hal_exti.h"
../Src/system_stm32f1xx.c: 0 warnings, 1 error
"I2C\I2C.axf" - 19 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:31

生成的工程一个字都没有改。
求大神指点。


已邀请:

TECHMM

赞同来自:

很明显少了库文件stm32f1xx_hal_exti.c和stm32f1xx_hal_exti.h.


到STM32Cube_FW_F1_V1.8.0

的Drivers\STM32F1xx_HAL_Driver\Src目录把少的文件复制到项目。


BG4RFF

赞同来自:

复制全部库文件吧,不知道是是不是

shaojunxian - 90后

赞同来自:

怎么好的

要回复问题请先登录注册