项目场景
Keil Studio for VScode 创建工程
问题描述
出现 ‘RTE_Components.h’ was not found,并且无法编译。
原因分析
Arm CMSIS csolution
extension 的一个 bug,最后从 CMSIS Build Manager
的 output 查出问题。
cbuild d:\Develop\Projects\VSCodeProjects\demo\demo.csolution.yml -t database --context .Debug+STM32F103C8
spawn cbuild ENOENT
cbuild d:\Develop\Projects\VSCodeProjects\demo\demo.csolution.yml -t database --context .Debug+STM32F103C8
info cbuild: Build Invocation 2.2.1 (C) 2023 Arm Ltd. and Contributors
D:/Develop/Projects/VSCodeProjects/demo/demo.cbuild-idx.yml - info csolution: file generated successfully
D:/Develop/Projects/VSCodeProjects/demo/Project/Project.Debug+STM32F103C8.cbuild.yml - info csolution: file generated successfully
D:/Develop/Projects/VSCodeProjects/demo/demo.cbuild-pack.yml - info csolution: file generated successfully
D:/Develop/Projects/VSCodeProjects/demo/Project/Project.Debug+STM32F103C8.cprj - info csolution: file generated successfully
info cbuild: Processing 1 context(s)
info cbuild: Retrieve build information for context: "Project.Debug+STM32F103C8"
================================================================
info cbuild: (1/1) Building context: "Project.Debug+STM32F103C8"
M650: Command completed successfully.
*** WARNING M634:
File 'd:/Develop/Projects/VSCodeProjects/demo/Project/RTE/_Debug_STM32F103C8/RTE_Components.h' was not found, use the option '--update-rte' to generate it
*** ERROR M204:
Path not found: 'd:/Develop/Projects/VSCodeProjects/demo/Project/RTE/_Debug_STM32F103C8'!
error cbuild: error executing 'cbuildgen cmake'
error cbuild: error building 'd:\Develop\Projects\VSCodeProjects\demo\Project\Project.Debug+STM32F103C8.cprj'
error cbuild: exit status 1
Process failed with exit code 4294967295
Process failed with exit code 4294967295
解决方案
根据 Log 提示,输入以下命令
cbuild xxx.csolution.yml --update-rte
xxx
换成你 csolution project 的名字
例如我的
我就需要输入命令:
cbuild demo.csolution.yml --update-rte