Build Error when using Automotive Math and Motor Control Library set for MPC5748G

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Build Error when using Automotive Math and Motor Control Library set for MPC5748G

Jump to solution
1,092 Views
jzhang1
Contributor II

I installed the "Automotive Math and Motor Control Library set for MPC5748G" following by its user guide.

But I got many error messages while I'm only using the function of "Acos", does anyone know the reason? I'm posting my code and error messages as below.

Code: (omit the unnecessary code)

#include "derivative.h" /* Include peripheral declarations */
#include "project.h" /* Define Macros */
#include "mode.h" /* Change clock modes */
#include "adc.h" /* Configure ADC */
#include "GFLIB_Acos.h"

#define GFLIB_ACOS_DEFAULT_F16 &f16gflibAcosCoef

extern uint16_t Result;

tFloat f16Input;
tFloat f16Angle;

int main(void)
{

   ...

    while(1) {
   if (ADC_1.ISR.B.ECH)

    { 
         ADC1_Read_Chan(); /* Read conversion Results from ADC*/
         f16Input = FRAC16(Result);
         f16Angle = GFLIB_Acos_F16(f16Input, GFLIB_ACOS_DEFAULT_F16);

         ...

      }

   }

}

Error message:

pastedImage_14.png

pastedImage_20.png

And there are many similar prefix "SWLIB_xxx", "MLIB_xxx", "GFLIB_xxx" with the following error "error: operator '==' has no left operand" shown in the console.

While the example on the user guide is very simple, but it causes the same errors as above.pastedImage_15.png

0 Kudos
1 Solution
1,011 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

regarding error I see only way that you have incorrectly added Library search path - in your screenshot is missing the end of path, so it is not clear if you added correct path including the selected core (e200z2 vs e200z4).

If you have separated project for each core you have to set the library path for each core for those projects.

EWL vs bewlib - this is usually selected in project wizard which will ensure all necessary settings.

regards,
Peter

View solution in original post

0 Kudos
3 Replies
1,011 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

  1. It is necessary to set the macro SWLIBS_DEFAULT_IMPLEMENTATION in the file SWLIBS_Config.h (see AMMCLIB User's Guide for help).
  2. The AMMCLIB integrated in the S32DS is obsolete. Download the current version from www.nxp.com/AutoMCLib.
     
  3. Even though the S32DS project wizard allows users to use the EWL library together with AMMCLIB, this combination is actually not supported. Use newlib instead.

regards,
Peter

0 Kudos
1,011 Views
jzhang1
Contributor II

Thanks for your response.

I have downloaded the latest version and installed it by the user's guide. And now it only shows 1 error message when build.

pastedImage_1.png

which is very strange, because I already add "mpc574xG_AMMCLIB.a" in the library. Please see the screenshot below.

pastedImage_2.png

For the 3) you mentioned, do you mean I have to delete the EWL library while I'm using the Ammclib? Or just EWL and AMMClib cannot use it together?

pastedImage_3.png

Original code has modified to define the "SWLIBS_DEFAULT_IMPLEMENTATION".

#include "gflib.h"
#include "SWLIBS_Config.h"

#define SWLIBS_DEFAULT_IMPLEMENTATION SWLIBS_DEFAULT_IMPLEMENTATION_F16

Regards,

Junyi

0 Kudos
1,012 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

regarding error I see only way that you have incorrectly added Library search path - in your screenshot is missing the end of path, so it is not clear if you added correct path including the selected core (e200z2 vs e200z4).

If you have separated project for each core you have to set the library path for each core for those projects.

EWL vs bewlib - this is usually selected in project wizard which will ensure all necessary settings.

regards,
Peter

0 Kudos