This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error: L6218E - undefined symbol

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

Parents
  • 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

Reply
  • 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

Children
  • 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.