2018-06-08 1:52 PM
Hi all,
I'm trying to get started with the Motor Control SDK 5.1.0, after viewing the webinar. Hardware is a Nucleo F302R8, Nucleo-IHM07M1 (in 3 shunt configuration), and the bullrunning 1700 kV motor. The motor profiler runs, although I couldn't get it working (it doesn't give stable rotation). That's ok for now, as it indicates the HW/SW platform is in working condition.
The steps taken are as follows:
- Use MCSDK 5.1.0 with the hardware mentioned above, to generate an .ioc file. For code generation, SW4STM32 is selected.
- Open the .ioc file in STM32CubeMX 4.26.0
- Generate code, and click 'open project', which opens SW4STM32
- Build the project in SW4STM32. The building runs quite far, until the following error is thrown:
Building target: motorTestC.elf
Invoking: MCU GCC Linkerarm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs -specs=nano.specs -T'../STM32F302R8Tx_FLASH.ld' -Wl,-Map=output.map -Wl,--gc-sections -o 'motorTestC.elf' @'objects.list' -lmApplication/User/mc_tasks.o: In function `MCboot':C:/PATH/motorTestC/Src/mc_tasks.c:184: undefined reference to `STO_PLL_Init'C:/PATH/motorTestC/Src/mc_tasks.c:188: undefined reference to `RUC_Init'Application/User/mc_tasks.o: In function `TSK_MediumFrequencyTaskM1':C:/PATH/motorTestC/Src/mc_tasks.c:308: undefined reference to `STO_PLL_CalcAvrgMecSpeed01Hz'C:/PATH/motorTestC/Src/mc_tasks.c:337: undefined reference to `RUC_Clear'C:/PATH/motorTestC/Src/mc_tasks.c:339: undefined reference to `STO_PLL_Clear'C:/PATH/motorTestC/Src/mc_tasks.c:353: undefined reference to `RUC_Exec'C:/PATH/motorTestC/Src/mc_tasks.c:367: undefined reference to `STO_PLL_IsObserverConverged'Application/User/mc_tasks.o: In function `TSK_HighFrequencyTask':C:/PATH/motorTestC/Src/mc_tasks.c:647: undefined reference to `RUC_FirstAccelerationStageReached'C:/PATH/motorTestC/Src/mc_tasks.c:650: undefined reference to `STO_PLL_CalcElAngle'C:/PATH/motorTestC/Src/mc_tasks.c:651: undefined reference to `STO_PLL_CalcAvrgElSpeedDpp'C:/PATH/motorTestC/Src/mc_tasks.c:654: undefined reference to `STO_ResetPLL'Application/User/user_interface.o: In function `UI_SetReg':C:/PATH/motorTestC/Src/user_interface.c:270: undefined reference to `STO_PLL_GetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:271: undefined reference to `STO_PLL_SetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:290: undefined reference to `STO_PLL_GetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:291: undefined reference to `STO_PLL_SetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:310: undefined reference to `STO_GetPLLGains'C:/PATH/motorTestC/Src/user_interface.c:311: undefined reference to `STO_SetPLLGains'C:/PATH/motorTestC/Src/user_interface.c:331: undefined reference to `STO_GetPLLGains'C:/PATH/motorTestC/Src/user_interface.c:332: undefined reference to `STO_SetPLLGains'Application/User/user_interface.o: In function `UI_GetReg':C:/PATH/motorTestC/Src/user_interface.c:591: undefined reference to `RUC_GetNumberOfPhases'C:/PATH/motorTestC/Src/user_interface.c:520: undefined reference to `STO_GetPLLGains'C:/PATH/motorTestC/Src/user_interface.c:500: undefined reference to `STO_PLL_GetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:480: undefined reference to `STO_PLL_GetObserverGains'C:/PATH/motorTestC/Src/user_interface.c:540: undefined reference to `STO_GetPLLGains'C:/PATH/motorTestC/Src/user_interface.c:694: undefined reference to `STO_PLL_GetEstimatedCurrent'C:/PATH/motorTestC/Src/user_interface.c:800: undefined reference to `STO_PLL_GetEstimatedBemfLevel'C:/PATH/motorTestC/Src/user_interface.c:818: undefined reference to `STO_PLL_GetObservedBemfLevel'C:/PATH/motorTestC/Src/user_interface.c:748: undefined reference to `STO_PLL_GetEstimatedBemf'C:/PATH/motorTestC/Src/user_interface.c:730: undefined reference to `STO_PLL_GetEstimatedBemf'C:/PATH/motorTestC/Src/user_interface.c:712: undefined reference to `STO_PLL_GetEstimatedCurrent'Application/User/user_interface.o: In function `UI_GetRevupData':C:/PATH/motorTestC/Src/user_interface.c:1005: undefined reference to `RUC_GetPhaseDurationms'C:/PATH/motorTestC/Src/user_interface.c:1006: undefined reference to `RUC_GetPhaseFinalMecSpeed01Hz'C:/PATH/motorTestC/Src/user_interface.c:1007: undefined reference to `RUC_GetPhaseFinalTorque'Application/User/user_interface.o: In function `UI_SetRevupData':C:/PATH/motorTestC/Src/user_interface.c:1032: undefined reference to `RUC_SetPhaseDurationms'C:/PATH/motorTestC/Src/user_interface.c:1033: undefined reference to `RUC_SetPhaseFinalMecSpeed01Hz'C:/PATH/motorTestC/Src/user_interface.c:1034: undefined reference to `RUC_SetPhaseFinalTorque'Application/User/mc_config.o:(.data+0x2d4): undefined reference to `STO_PLL_ForceConvergency1'Application/User/mc_config.o:(.data+0x2d8): undefined reference to `STO_PLL_ForceConvergency2'Application/User/mc_config.o:(.data+0x2dc): undefined reference to `STO_OTF_ResetPLL'Application/User/mc_config.o:(.data+0x2e0): undefined reference to `STO_PLL_IsVarianceTight'collect2.exe: error: ld returned 1 exit statusmakefile:37: recipe for target 'motorTestC.elf' failedmake: *** [motorTestC.elf] Error 1Can anyone explain why this happens, and how it can be solved? Thanks a lot in advance! In case additional input is needed, feel free to ask.
Solved! Go to Solution.
2018-06-09 4:24 PM
Hi
klopwouter
,From the error message, it prompts that the lib of mc was missing from link.
To manually fix the problem, you can go 'project properties' --> 'C/C++ Build' --> 'Settings' --> 'Tools settings' --> 'MCU GCC Linker' --> 'Libraries'
in 'Libraries (-l)' , add :libmc-truestudio_M4.lib
in 'Library searching path (-L)' , add ../../../MCSDK_v5.1.0/MotorControl/lib
Hope this will help.
BTW, the sw4stm32 and truestudio both use GCC, so the lib was shared.
-Andy
2018-06-09 4:24 PM
Hi
klopwouter
,From the error message, it prompts that the lib of mc was missing from link.
To manually fix the problem, you can go 'project properties' --> 'C/C++ Build' --> 'Settings' --> 'Tools settings' --> 'MCU GCC Linker' --> 'Libraries'
in 'Libraries (-l)' , add :libmc-truestudio_M4.lib
in 'Library searching path (-L)' , add ../../../MCSDK_v5.1.0/MotorControl/lib
Hope this will help.
BTW, the sw4stm32 and truestudio both use GCC, so the lib was shared.
-Andy
2018-06-10 4:13 AM
Hi
Blue.Andy
,Thanks for the quick reply! Your solution works perfect. One small addition is that the lib folder was not available in the project folder, so I copied the lib folder from the Program files directory.
Thanks a lot for helping me out
2021-06-15 1:26 AM
The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK).
Best regards
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.