Menu

#69 HAL Driver error "undefined reference to"

Version 1.x
closed
None
5
2015-01-26
2014-09-07
No

Hello.

In main.c I try to use some functions from stm32f4xx_hal_tim.c library file, but have the following errors:
...
./src/main.o: In function main': /home/hoverjet/Dropbox/Work/Robotics/Tod/Software/ARM/workspace/tim_2/Debug/../src/main.c:135: undefined reference toHAL_TIM_Base_Init'
/home/hoverjet/Dropbox/Work/Robotics/Tod/Software/ARM/workspace/tim_2/Debug/../src/main.c:143: undefined reference to `HAL_TIM_Base_Start_IT'
collect2: error: ld returned 1 exit status
make: *** [tim_2.elf] Error 1

Includes in main.cpp:

include <stdio.h></stdio.h>

include "diag/Trace.h"

include "stm32f4_discovery.h"

include "stm32f4xx_hal.h"

The ARM Eclipse Plugin (the latest version from Sourceforge)
Eclipse 4.3 SR2 Kepler
openjdk-7-jre
Ubuntu 14.04
gcc-arm-none-eabi-4.8-2014q2
Open On-Chip Debugger 0.8.0
Template: "C Project / STM32F4XX C/C++ Project" - Content (Empty)

1 Attachments

Discussion

  • Liviu Ionescu (ilg)

    When you created the project you asked to exclude unused source files. This means that only a small number of library functions were compiled.

    Go to the system/src/stm32f4-hal, identify the timer source file and disable the Resource Configuration -> Exclude from Build.

     
  • Liviu Ionescu (ilg)

    • status: open --> accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • Vlad Merkulov

    Vlad Merkulov - 2014-09-07

    It works. Thank you!

     
    • Liviu Ionescu (ilg)

      you're welcome!

       
  • Liviu Ionescu (ilg)

    • status: accepted --> closed