RTE_Components.h not generated in STMCubeMX project
Answered
I get this error when trying to use CLion for STM32 development, both on Windows and Ubuntu. The file should be autogenerated somewhere in the build process.
/home/marek/workspace/nucleo-clion/Drivers/CMSIS/Core/Template/ARMv8-M/main_s.c:28:28: fatal error: RTE_Components.h: No such file or directory
#include "RTE_Components.h"
I set up the project following instructions on https://www.jetbrains.com/help/clion/embedded-development.html
I am stuck how to resolve it for a few weeks now (I can normally build with Cube IDE), any comments would be appreciated.
Please sign in to leave a comment.
Same problem
I fixed this by changing line 40 in CMakeLists.txt to not pull in everything from Drivers/ but only the HAL:
Probably the project was was generated for the wrong IDE first, or some outdated STM32CubeMX.
How to fix:
- Update CubeMX to newest version
- Delete all CubeMX files except manually modified and .ioc file
- Regenerate sources
Side note: If you need to make any changes to `CMakeLists.txt`, please reflect those changes to it's template, which is kept in the project root. Otherwise your changes to `CMakeLists.txt` are going to be lost when the project is regenerated.