在 STMCubeIDE 中创建一个新的 C 项目时,收到以下错误消息:
Code generation could not be done most probably because the necessary firmware package is missing. Not able to complete STM32Cube project creation. See Firmware Updater for settings related to firmware package installation Tips: Please use the Device Configuration Tool, and then use 'Project > Generate Code' to complete the project generation.
意思是:无法生成代码很可能是因为缺少必要的固件包。无法完成STM32Cube项目创建。有关固件包安装相关的设置,请参阅固件更新程序 提示:请使用设备配置工具,然后使用“项目>生成代码”完成项目生成。
下面两种方法是从网上找到的。
方法1:
可以通过下面的操作方法解决:
- 从此页面https://www.st.com/en/embedded-software/stm32cubef4.html下载两个zip(STM32CubeF4和Patch-CubeF4)
- 先解压en.STM32Cube_FW_F4_V1.24.0.zip到Repository文件夹
- 然后将 en.patch_cubefw_f4.zip 解压到同一个文件夹并替换文件
- 完成!
其中, Repository 文件夹的路径为:C:/Users//STM32CUBE/Repository
方法2:
如果 IDE 正常工作,选择菜单项 Help->“Manage Embedded Software Packages”
它将指导安装上面提到的固件包。之后,可以将该 zip 文件中的示例作为项目导入 IDE。