Skip to main content
MMira.2
Associate II
June 20, 2024
Question

CubeIDE and CubeMX error undefined reference HAL Library

  • June 20, 2024
  • 7 replies
  • 5098 views

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

This topic has been closed for replies.

7 replies

Senior III
June 20, 2024

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

"If you feel a post has answered your question, please click ""Accept as Solution""."
MMira.2
MMira.2Author
Associate II
June 20, 2024

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 DeepL.com (free version)

Senior III
June 20, 2024

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

"If you feel a post has answered your question, please click ""Accept as Solution""."
Pavel A.
June 21, 2024

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.