STM32的VSCODE编译问题
因此,VSCODE愉快地为我的STM MicroController(STM32WB)编写代码。我将在VSCODE中编写代码,并在STM32Cubeide中编译并运行。 但是,最近,Vscode的Intellisense正在行动。它检测到诸如 标识符“ UINT8_T”是未定义的
。此外,VSCODE的“输出”选项卡给出以下错误:
Unable to resolve configuration with compilerPath: "C:/ST/STM32CubeIDE_1.8.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/arm-none-eabi-gcc.exe"
路径本身似乎很好。如果我从命令提示符中发出该命令,我会得到
arm-none-eabi-gcc.exe: fatal error: no input files
compilation terminated.
这是预期的响应。
关于我接下来可以尝试的什么建议?我觉得我缺少一些小东西!
更多信息:
- 我尝试在C_CPP_Properties.json中广泛玩耍 文件。
- 我尝试通过STM32Cubeide下载另一个工具链,然后使用该路径。
- 我尝试在Windows环境路径中添加路径。
这是我的C_CPP_PROPERTIES.JSON文件(大多数设置是从STM32Cubeide默认设置的内容复制/粘贴:
{
"configurations": [
{
"name": "STM32",
"includePath": [
"${workspaceFolder}/**",
"C:\\ST\\STM32CubeIDE_1.8.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\\tools\\**",
"${workspaceFolder}/Drivers/STM32WBxx_HAL_Driver/Inc",
"${workspaceFolder}/Drivers/CMSIS/Device/ST/STM32WBxx/Include",
"${workspaceFolder}/Drivers/CMSIS/Include",
"${workspaceFolder}/Core/Inc",
"${workspaceFolder}/STM32CubeIDE/Application/Core",
"${workspaceFolder}/STM32CubeIDE/Drivers/STM32WBxx_HAL_Driver",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble/core",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/utilities",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble",
"${workspaceFolder}/STM32_WPAN/App",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble/core/template",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN",
"${workspaceFolder}/Utilities/sequencer"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"USE_HAL_DRIVER",
"DEBUG",
"STM32WB55xx"
],
"compilerPath": "C:/ST/STM32CubeIDE_1.8.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/arm-none-eabi-gcc.exe",
"compilerArgs": [
"-mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DUSE_STM32WBXX_NUCLEO -DCORE_CM4 -DSTM32WB55xx -c -I../../Core/Inc -I../../Utilities/lpm/tiny_lpm -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci -I../../Utilities/sequencer -I../../Drivers/CMSIS/Device/ST/STM32WBxx/Include -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl -I../../STM32_WPAN/App -I../../Middlewares/ST/STM32_WPAN/ble/core -I../../Middlewares/ST/STM32_WPAN -I../../Middlewares/ST/STM32_WPAN/ble/core/template -I../../Drivers/BSP/P-NUCLEO-WB55.Nucleo -I../../Drivers/STM32WBxx_HAL_Driver/Inc -I../../Middlewares/ST/STM32_WPAN/ble/core/auto -I../../Middlewares/ST/STM32_WPAN/utilities -I../../Middlewares/ST/STM32_WPAN/ble -I../../Drivers/CMSIS/Include -Os -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb"
],
"cStandard": "gnu11",
"cppStandard": "gnu++11",
"intelliSenseMode": "windows-gcc-arm",
}
],
"version": 4
}
So, VSCode was working happily for writing code for my STM microcontroller (STM32WB). I would write the code in VSCode and compile and run in STM32CubeIDE.
Lately, however, VSCode's IntelliSense is acting up. It detects problems such asidentifier "uint8_t" is undefined
. Furthermore, the 'Output' tab of VSCode gives the following error:
Unable to resolve configuration with compilerPath: "C:/ST/STM32CubeIDE_1.8.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/arm-none-eabi-gcc.exe"
The path itself appears to be fine. If I issue that command from command prompt, I get
arm-none-eabi-gcc.exe: fatal error: no input files
compilation terminated.
which is the expected response.
Any suggestions on what I can try next? I feel like I'm missing something small!
More info:
- I've tried extensively playing around in the c_cpp_properties.json
file. - I've tried downloading another toolchain through STM32CubeIDE and using that path instead.
- I've tried adding the path to the Windows environment path.
Here is my c_cpp_properties.json file (most of the settings are copy/paste from what STM32CubeIDE sets up by default:
{
"configurations": [
{
"name": "STM32",
"includePath": [
"${workspaceFolder}/**",
"C:\\ST\\STM32CubeIDE_1.8.0\\STM32CubeIDE\\plugins\\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\\tools\\**",
"${workspaceFolder}/Drivers/STM32WBxx_HAL_Driver/Inc",
"${workspaceFolder}/Drivers/CMSIS/Device/ST/STM32WBxx/Include",
"${workspaceFolder}/Drivers/CMSIS/Include",
"${workspaceFolder}/Core/Inc",
"${workspaceFolder}/STM32CubeIDE/Application/Core",
"${workspaceFolder}/STM32CubeIDE/Drivers/STM32WBxx_HAL_Driver",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble/core",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/utilities",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble",
"${workspaceFolder}/STM32_WPAN/App",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN/ble/core/template",
"${workspaceFolder}/Middlewares/ST/STM32_WPAN",
"${workspaceFolder}/Utilities/sequencer"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"USE_HAL_DRIVER",
"DEBUG",
"STM32WB55xx"
],
"compilerPath": "C:/ST/STM32CubeIDE_1.8.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127/tools/bin/arm-none-eabi-gcc.exe",
"compilerArgs": [
"-mcpu=cortex-m4 -std=gnu11 -g3 -DUSE_HAL_DRIVER -DUSE_STM32WBXX_NUCLEO -DCORE_CM4 -DSTM32WB55xx -c -I../../Core/Inc -I../../Utilities/lpm/tiny_lpm -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/shci -I../../Utilities/sequencer -I../../Drivers/CMSIS/Device/ST/STM32WBxx/Include -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread -I../../Middlewares/ST/STM32_WPAN/interface/patterns/ble_thread/tl -I../../STM32_WPAN/App -I../../Middlewares/ST/STM32_WPAN/ble/core -I../../Middlewares/ST/STM32_WPAN -I../../Middlewares/ST/STM32_WPAN/ble/core/template -I../../Drivers/BSP/P-NUCLEO-WB55.Nucleo -I../../Drivers/STM32WBxx_HAL_Driver/Inc -I../../Middlewares/ST/STM32_WPAN/ble/core/auto -I../../Middlewares/ST/STM32_WPAN/utilities -I../../Middlewares/ST/STM32_WPAN/ble -I../../Drivers/CMSIS/Include -Os -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb"
],
"cStandard": "gnu11",
"cppStandard": "gnu++11",
"intelliSenseMode": "windows-gcc-arm",
}
],
"version": 4
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
c_cpp_properties.json选修的。确实,只需评论可选的
compilerargs
参数即可解决问题。至少到了Intellisense再次正常工作的时候。请注意,一些-dxxxx参数必须移动到定义
(例如-duse_stm32wbxx_nucleo)。这确实是有道理的,因为您已经定义了.json文件中其他位置的大量
compilerargs
(例如定义
和incress> includepath
)。The c_cpp_properties.json reference indicates that some fields are optional. Indeed, simply commenting out the optional
compilerArgs
parameter resolves the issue. At least to a point that IntelliSense is working correctly again. Note that some of the -DXXXX parameters had to be moved todefines
(e.g. -DUSE_STM32WBXX_NUCLEO).It does make some sense, since you are already defining a lot of the
compilerArgs
elsewhere in the .json file (likedefines
andincludePath
).