Showing results for 
Search instead for 
Did you mean: 

Undefined HAL symbols, in Keil

Associate III

I have existing working code which uses uart and some GPIO functions. Its main.h has,

#include "ll_common.h", #include "stm32h7xx_ll_gpio.h", #include "stm32h7xx_ll_usart.h"

and few more ll headers.

Now I need to add I2C functionality to the code. I go through the code given at

en.stm32cubeh7_v1-7-0\STM32Cube_FW_H7_V1.7.0\Projects\STM32H743I-EVAL\Examples\I2C\I2C_EEPROM_fast_mode_plus\MDK-ARM, as the code uses HAL drivers , I make the following changes,

  1. Add

#include "stm32h7xx_hal.h"

#include "stm32h7xx_nucleo.h (in example its stm32h743i_eval.h)

2. Add USE_HAL_DRIVER to compiler per-proceesor symbols(it already has USE_FULL_LL_DRIVER)

3. I add stm32h7xx_hal.h, stm32h7xx_nucleo.h,stm32h7xx_hal_conf.h, stm32h7xx_nucleo_conf.h, stm32h7xx_nucleo_errno.h, stm32h7xx_hal_i2c.h, stm32h7xx_hal_i2c.c to the project.

4. I also confirm that in stm32h7xx_hal_conf.h , #define HAL_MODULE_ENABLED and all other relevant modules are enabled.

Even with all these, I am getting compilation error like

.\STM32H745I_Nucleo_CM7\Exe\STM32H745I_Nucleo_CM7.axf: Error: L6218E: Undefined symbol HAL_EXTI_GetHandle (referred from stm32h7xx_nucleo.o).

.\STM32H745I_Nucleo_CM7\Exe\STM32H745I_Nucleo_CM7.axf: Error: L6218E: Undefined symbol HAL_EXTI_IRQHandler (referred from stm32h7xx_nucleo.o).

.\STM32H745I_Nucleo_CM7\Exe\STM32H745I_Nucleo_CM7.axf: Error: L6218E: Undefined symbol HAL_EXTI_RegisterCallback (referred from stm32h7xx_nucleo.o).

and many more.... basically compiler is not able able to see any HAL symbols.

KEil Version:

What am I missing ?

Also I am using NUCLEO-H745ZI-Q, but keil does not support this board. Can this be a possible reason?

I tried all that I possibly could, I am stuck.

Any help is appreciated. Thanks in advance.


Ok, HEADER files describe interfaces, they don't typically contain the code required for linkage.

Need to add the library SOURCE files to get closure, ie


Try Keil 5.29

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for such prompt reply. I did add stm32h7xx_hal_exti.c, but still same undefined HAL symbol errors are coming.

Do I have to add other files like these. How do I know which files , I have add. Is there any document stating, the the code flow among HAL files ?

I have gone through the HAL and LL driver document but I think , what am missing is the dependency among HAL files and their behavior when LL files are used along with HAL files.

Chief II

Those errors mean that stm32h7xx_hal_exti.c is still not added/compiled/linked properly.