Skip to main content
MM1
Associate II
August 17, 2021
Solved

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

  • August 17, 2021
  • 2 replies
  • 10433 views

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

This topic has been closed for replies.
Best answer by Imen.D

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

2 replies

Imen.DBest answer
ST Technical Moderator
August 17, 2021

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
MM1
MM1Author
Associate II
August 18, 2021

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 III
January 13, 2023

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?

Piranha
Principal III
January 15, 2023