We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am experimenting an issue with my Keil project. I am using the STM32CubeF7 HAL to programa a module I need.
I search some info about similar problems and I found some comments about declaring a function but not defining it as the cause for all of this linker "undefined symbols" problems. In my case I have the "stm32f7xx_hal_uart.h" and the "stm32f7xx_hal_uart.c" added to my project so I think the problem could be different.
The error throw by Keil is the same I found in other posts :
linking... .\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_DeInit (referred from hal_communications.o). .\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Init (referred from hal_communications.o). .\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Receive_DMA (referred from hal_communications.o). .\Objects\uart_hal_cube_st_testing.axf: Error: L6218E: Undefined symbol HAL_UART_Transmit_DMA (referred from hal_communications.o). Not enough information to list image symbols. Finished: 1 information, 0 warning and 4 error messages. ".\Objects\uart_hal_cube_st_testing.axf" - 4 Error(s), 3 Warning(s).
But, as I said, I have those functions declared and defined inside my project. Anyone could help with this?
Thanks in advanced, Omar
But, clearly, the Linker is not finding them - is it?
Do a complete, clean build and look at the build output:
- is the stm32f7xx_hal_uart.c file actually being compiled?
- is a stm32f7xx_hal_uart.o file actually created?
- is the stm32f7xx_hal_uart.o file in a place that the linker can find it?
Hi Andrew,
thanks for the answer.
I have made a complete and clean build and the "stm32f7_hal_uart.c" has been compiled. Then I looked at the Object project folder and there it is the "stm32f7_hal_uart.o" for the linker.
In the module I am trying to program I am using some extern variables. They were declared inside "my_module.h" and defined inside "my_module.c" so they could be called from anywhere. I am not sure whether this could be the cause of this problem.
As a test I eliminated those extern variables defining them inside the "main.c" and pass them as arguments to the functions inside "my_module.c" but I obtained the same error from the linker.
Any other clue about what could be happening?
Thanks again, Omar
Try to modify the missed function and let its syntax error. (For example, delete a necessary ";") And just compile the file, which defines the function. If the compile pass, obviously the function is not really compiled. Maybe you modified wrong file, maybe you missed a #define to let it active...etc.