Showing results for 
Search instead for 
Did you mean: 

CubeIDE and CubeMX error undefined reference HAL Library

Associate II

Good morning,

I am writing for assistance on a problem that is occurring frequently in using STM32CubeIDE and STM32CubeMX.

Created a project from CubeMX with the configurations for an STM32 H7 and developed with CubeIDE, what happens is that if I make changes to the .ioc file again from CubeMX upon subsequent recompilation on CubeIDE "undefined reference to ..." errors are generated for all the HAL library functions in the project.

I am using Version: 1.15.1 for CubeIDE and Version 6.11.1 for CubeMX

Can you provide me with a solution to the problem that occurs both using CubeMX from separate software and within the IDE

Thank you

Senior II

please check if you have #include "stm32f0xx_hal.h" in your main.h . This file as all the necessary definitions.

There will be another file halXXXXconf.h also in your project core/inc

Hi thanks for the answer,
Why should I include stm32f0xx_hal.h if my system is based on h7?
The library files are present in main.h, I included #include "stm32h7xx_hal.h" in fact at the beginning just created the project everything works and I can develop.
Everything changes when I make a change in the .ioc file. Generating the new configuration code with the change, for example adding a new GPIO, the problem occurs.
If I create a new project from the same .ioc everything goes back to working as before

Translated with (free version)

Sorry it .not stm32f0xxhal, it's hal for your processor 

Sorry it's for stm32f030, it was a typo, it has to be hal for your processor. 

I have done other tests, but the problem remains.
I initialize a new project with an .ioc file and everything works correctly. I make changes even as simple as adding a GPIO and when I recompile the project, it loses the HAL library references.
Can anyone help me with this?

Pavel A.
Evangelist III

There are known cases when Eclipse (CubeIDE) corrupts the project after external changes and refresh. Of course this does not reproduce always, but occurred for me many times (and then returned to normal by itself). What to do: keep your project in version control. In case of problems after re-generation by CubeMX, compare and revert unwanted changes.


Can you send the zip of your project directory  with the original configuration, so that I will open it in my computer and make changes to GPIO and see what happens.. Let us try