cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE: fatal error: core_cm4.h: No such file or directory

MM1
Associate II

Hi there,

I am having trouble with CubeIDE: When building my project i get the following error:

"fatal error: core_cm4.h: No such file or directory"

I am using:

  • MCSDK 5.Y.1
  • STM32CubeMX
  • STM32CubeIDE 1.6.1
  • STM32F302R8 NucleoBoard
  • X-NUCLEO-IHM07M1 motor driver
  • SPI-Sensor
  • two external buttons

What I did to get to this point:

  • Generated the project via MotorControl Workbench and CubeMX --> project is for a Motor Control application
  • Modified the project with CubeMX: added few GPIO Inputs and Outputs, added a Timer (TIM16) and SPI2
  • Added the Project to the CubeIDE workspace
  • added some own Code
  • hit build
  • got the error: "fatal error: core_cm4.h: No such file or directory"
  • tried to add the include path manually --> did not work

Hope someone can help me on this

Greetings MM1

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @MM1​ ,

It seems the include paths are not properly set up.

Please make sure to configure the include paths and check the path of the core_cm4.h header file. Maybe that folder was not in the include folder list.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

4 REPLIES 4
Imen.D
ST Employee

Hello @MM1​ ,

It seems the include paths are not properly set up.

Please make sure to configure the include paths and check the path of the core_cm4.h header file. Maybe that folder was not in the include folder list.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
MM1
Associate II

Hi Imen,

Thanks for the reply. I double checked the include paths and the path to the core_cm4.h was indeed missing.

It is just sad that you have to do it manually sometimes when using the Toolchain MotorControl Workbench/CubeMX (happened to me before)

greeting MM1

Angle
Associate II

hi, I know it has been a year ago, but may I know how to include the path? i mean how to find the path library and put it in the path?