最近将PMSM的FOC2的2.0的库移植到
STM32f051xx上,移植过程中发现几个纠结的问题,看看有没有哪位前辈遇到过啊:
1在编译的时候发现如下错误(在基于051的外设库函数的工程中编译的):
..Outputsvpwm.axf: Error: L6218E: Undefined symbol STO_Get_Electrical_Angle (referred from stm32f0xx_it.o)
...Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_Electrical_Angle (referred from stm32f0xx_it.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_wBemf_alfa_est (referred from stm32f0xx_it.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_wBemf_beta_est (referred from stm32f0xx_it.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_wIalfa_est (referred from stm32f0xx_it.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_wIbeta_est (referred from stm32f0xx_it.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
FOC_FluxRegulator (referred from mc_foc_drive.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
FOC_FluxRegulator_Init (referred from mc_foc_drive.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
FOC_FluxRegulator_Update (referred from mc_foc_drive.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Calc_Rotor_Angle (referred from mc_foc_drive.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Gains_Init (referred from mc_state_observer_interface.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Gains_Update (referred from mc_state_observer_interface.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Get_Speed (referred from mc_state_observer_interface.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_IsSpeed_Reliable (referred from mc_state_observer_interface.o).
..Outputsvpwm.axf: Error: L6218E: Undefined symbol
STO_Calc_Speed (referred from stm32f10x_
timebase.o).
经查证,发现引起以上错误的原因是这些函数在相应的头文件里面只是声明了一下,但是在相应的 .C文件里面没有却
没有定义,刚开始还以为自己在移植的过程中不小心把这几个函数给删了呢,后来查了查原文件,确实是没有这几个函数,不知道这是库的开发人员保留让客户根据自己的需要自己编写,还是忘了写这几个函数了啊?
2,在基于103的外设库函数上编译此工程时,编译器不报错,不知道是为什么?但是在基于051的外设的库函数上编译此工程却提示了如上错误。
一周热门 更多>