2012-09-12 06:59 AM
Hi,
I work on atollic with stm32 foc sdk 3.2 for motor control. When I compil my project, I have always the same errors : ..\srcmain.c:40: undefined reference to `MCboot' ..\src/main.c:41: undefined reference to `MCI_ExecSpeedRamp' ..\src/main.c:42: undefined reference to `MCI_StartMotor' ..\src/main.c:44: undefined reference to `MCI_StopMotor' but no problem with CMCI oMCI[MC_NUM], CMCT oMCT[MC_NUM]; I have linked all files .h with the main file. Could you help me? Thank you my code : #define PROJECT_CHK #include ''CrossCheck.h'' #undef PROJECT_CHK #if defined(PFC_ENABLED) #include ''PIRegulatorClass.h'' #endif #include ''MCTuningClass.h'' #include ''MCInterfaceClass.h'' #if defined(PFC_ENABLED) #include ''PFCInit.h'' #include ''PFCApplication.h'' #endif #include ''MCTasks.h'' #include ''Parameters conversion.h'' #ifdef DUALDRIVE #include ''Parameters conversion motor 2.h'' #endif #include ''Timebase.h'' #include ''UITask.h'' #include ''MCLibraryISRPriorityConf.h'' #include <stdio.h> #include ''stm32_eval.h'' CMCI oMCI[MC_NUM]; CMCT oMCT[MC_NUM]; int main(void) { int i; MCboot(oMCI,oMCT); MCI_ExecSpeedRamp(oMCI[1],100,1000); MCI_StartMotor(oMCI[1]); for(i=0;i<=500000;i++); MCI_StopMotor(oMCI[1]); }2012-09-18 08:42 AM
Ciao Julien
I think that you have no problem with CMCI and CMCT because you has included the .h file but I fear that you need also to bulild and link the MC Application project that contatins the implementation of MCboot, MCI_ExecSpeedRamp and so on. You can take as guideline the provided IAR workspaces. Ciao Gigi2012-09-19 01:50 AM
Thank you for your answer,
I think it's because the library (single dual drive.a) is not recognized by atollic. When I add the library, the compilator don't find the way for library. There is a special way to add this library on Atollic ? Regards2012-09-19 03:07 AM
Ciao Julien,
one of the problem that I had using Atollic was when I forgot to add the prefix lib to the name of the linked library. It is possible that you have the same problem? Of course the library must be compiled with Atollic. Ciao Gigi2012-09-19 05:54 AM
2012-09-19 07:13 AM
Ciao Julien
I'm not an expert of Atollic IDE but I suppose that you have to put them under the scope of the project. Usually there is some setting on where you can set the path of the library you want to link. Is better that we study deeply the documentation of Atollic ;) Ciao Gigi2021-06-21 09:34 AM
The question has been moved from the section "Motor Control Hardware" to the "STM32 Motor Control" section (the question is about the STM32 MC SDK).
Best regards