cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `MCboot'

julienboudens9
Associate II
Posted on September 12, 2012 at 15:59

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]);

}
6 REPLIES 6
Gigi
Senior
Posted on September 18, 2012 at 17:42

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

Gigi

julienboudens9
Associate II
Posted on September 19, 2012 at 10:50

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 ?

Regards

Gigi
Senior
Posted on September 19, 2012 at 12:07

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

Gigi

0690X00000602xJQAQ.jpg

julienboudens9
Associate II
Posted on September 19, 2012 at 14:54

I must place this library into folder MCapplication library sdk foc 3.2 ?

Gigi
Senior
Posted on September 19, 2012 at 16:13

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

Gigi

Laurent Ca...
Lead II

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