[STM32F1] 使用F103 编译项目时(我使用默认代码)出现错误。

[复制链接]
549|6
 楼主| 梧桐uuu 发表于 2025-7-17 02:03 | 显示全部楼层 |阅读模式
错误信息如下:
在包含文件路径中(从 stm32f1xx.h 开始层层引用):
C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:131,
132 | #include "core_cm3.h"
     from C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h:30,
         from C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h:29,
         from C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Core/Inc/stm32f1xx_hal_conf.h:237,
         from C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h:30,
         from ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c:36:
C:/Users/maria/STM32CubeIDE/workspace_1.3.0/led_*****/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:132:10: fatal error: core_cm3.h: No such file or directory

classroom 发表于 2025-7-17 13:46 | 显示全部楼层
可能STM32CubeIDE 未正确设置 CMSIS 头文件的包含路径。
flycamelaaa 发表于 2025-7-17 13:46 | 显示全部楼层
重新生成代码。
stormwind123 发表于 2025-7-17 13:48 | 显示全部楼层
重新安装 STM32CubeIDE试试。
classroom 发表于 2025-7-17 13:49 | 显示全部楼层
估计是 CMSIS 头文件路径未正确配置或文件缺失。
powerantone 发表于 2025-7-17 19:47 | 显示全部楼层
项目中的 CMSIS 文件可能被误删或未正确导入。
probedog 发表于 2025-7-17 20:49 | 显示全部楼层
检查工具链,清理并重建项目。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

58

主题

60

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部