CW 10.6 display problem of tructured variable

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

CW 10.6 display problem of tructured variable

Jump to solution
1,590 Views
antonio66
Contributor III

Hello,

The CW10.6 in debug session do not show the structure of the variable:

the variable is declared in main.c like:

 

"MCSTRUC_FOC_PMSM_T gsM2_Drive;"

 

the structure "MCSTRUC_FOC_PMSM_T" is composed like:

 

typedef struct

{

    GFLIB_CONTROLLER_PI_P_PARAMS_T  sIdPiParams;        /* Id PI controller parameters */

    GFLIB_CONTROLLER_PI_P_PARAMS_T  sIqPiParams;        /* Iq PI controller parameters */

    GDFLIB_FILTER_IIR1_T            sIdZcFilter;        /* D current zero-cancellation filter */

    GDFLIB_FILTER_IIR1_T            sIqZcFilter;        /* Q current zero-cancellation filter */

    GDFLIB_FILTER_IIR1_T            sUDcBusFilter;    /* Dc bus voltage filter */

    MCLIB_3_COOR_SYST_T                sIABC;            /* Measured 3-phase current */

    MCLIB_2_COOR_SYST_ALPHA_BETA_T    sIAlBe;           /* Alpha/Beta current */

    MCLIB_2_COOR_SYST_D_Q_T            sIDQ;             /* DQ current */

    MCLIB_2_COOR_SYST_D_Q_T            sIDQReq;          /* DQ required current */

    MCLIB_2_COOR_SYST_D_Q_T            sIDQReqZc;          /* DQ required current after zero cancellation */

    MCLIB_2_COOR_SYST_D_Q_T            sIDQError;          /* DQ current error */

    MCLIB_3_COOR_SYST_T                sDutyABC;            /* Applied duty cycles ABC */

    MCLIB_2_COOR_SYST_ALPHA_BETA_T    sUAlBeReq;           /* Required Alpha/Beta voltage */

    MCLIB_2_COOR_SYST_ALPHA_BETA_T    sUAlBeComp;         /* Compensated to DC bus Alpha/Beta voltage */

    MCLIB_2_COOR_SYST_D_Q_T            sUDQReq;             /* Required DQ voltage */

    MCLIB_2_COOR_SYST_D_Q_T            sUDQController;     /* Required DQ voltage */

    MCLIB_ANGLE_T                    sAnglePosEl;         /* Electrical position sin/cos (at the moment of PWM current reading) */

    MCLIB_ANGLE_T                    sAnglePosElUpdate;/* Compensated electrical position sin/cos (at the moment of PWM update) */

    MCSTRUC_ALIGNMENT_T                sAlignment;        /* Alignment structure params */

    UWord16                         uw16SectorSVM;        /* SVM sector */

    Frac16                            f16DutyCycleLimit;    /* Max. allowable dutycycle in frac */

    Frac16                            f16UDcBus;            /* DC bus voltage */

    Frac16                            f16UDcBusFilt;        /* Filtered DC bus voltage */

    Int16                             i16IdPiSatFlag;        /* Id PI controller saturation flag */

    Int16                             i16IqPiSatFlag;        /* Iq PI controller saturation flag */

    bool                            bOpenLoop;            /* Current control loop is open */

    bool                            bUseMaxBus;            /* Calculate the max. possible DQ current controllers' output limits based on dc bus voltage */

    bool                            bUseZc;                /* User zero-cancellation filter */

} MCSTRUC_FOC_PMSM_T;

 

The compiler work right = no errors.

The program work on my board.

BUT the degub program do not show the variale of the structured "gsM2_Drive" like i showed in the following picture:

13389_13389.pngpastedImage_0.png

The same problem happen with this project in Freemaster.

Freemaster do not show me the structure of "gsM2_Drive" !

 

Somebody can help me ?

 

Thank

Antonio

Labels (1)
0 Kudos
1 Solution
1,251 Views
antonio66
Contributor III

Hi,

Initialize the variables and the problem is solved.

View solution in original post

0 Kudos
11 Replies
1,252 Views
antonio66
Contributor III

Hi,

Initialize the variables and the problem is solved.

0 Kudos
1,251 Views
BlackNight
NXP Employee
NXP Employee

Hi Antonio,

do you have any compiler warnings?

Are you including the header file with the declaration of MCSTRUC_FOC_PMSM_T before you are using that variable?

I suspect that something might be wrong with your includes?

Erich

0 Kudos
1,251 Views
antonio66
Contributor III

Hi Eric,

You are very reactive ! thankyuo a lot.

pastedImage_0.png

Yes before the declaration is included

#include "motor_structure.h"

where the type of structure is declared.

If is an include problem why the compiler work right ?

why the execution of the firmware is right and the other variable in freemaster work well ?

best regards

0 Kudos
1,251 Views
antonio66
Contributor III

Hi Erich,

The first warning is...

pastedImage_0.png

0 Kudos
1,251 Views
BlackNight
NXP Employee
NXP Employee

remove the comma after the number 5.

1,251 Views
antonio66
Contributor III

Hi Erich,

..done. Now i have no warning.

pastedImage_1.png

But still the problem is alive.

In debug and in freemaster lioke you can see here..

pastedImage_0.png

0 Kudos
1,251 Views
BlackNight
NXP Employee
NXP Employee

Hi Antonio,

I suggest that you fix all the warnings anyway.

That you can compile your sources does not mean that the debug information is correct (DWARF). The debugger and Freemaster rely on the debug information to show the variables with types. Are the other variables from that module shown properly? Not that you just have switched off debug information for it.

Erich

0 Kudos
1,251 Views
antonio66
Contributor III

Hi Erich,

Where i can switch On the debug information for a module?

Antonio

0 Kudos
1,251 Views
BlackNight
NXP Employee
NXP Employee

By default, it is turned on. But I have seen cases where users have accidentially disabled it. This is an option in the compiler.

But if you can step through that module which has that variable, and if you have all the other variables of that module/source visible in the debugger, then this is not your problem.

It looks like you are using the DSC compiler, and just a wild guess: it even could be that this compiler might have a problem to produce the correct debug information for your variable. Again, just a wild guess.

0 Kudos
1,251 Views
antonio66
Contributor III

Hi Erich,

Yes i'm using DSC compiler

you says "..it even could be that this compiler might have a problem to produce the correct debug information for your variable. "

Before my test I tried to open and compile the example project of freescale "56F84789_PFC_2PMSMsensorless_1.0" with the same

strructured variable and the freemaster show the right structure of the variable with all the members of it.

0 Kudos
1,251 Views
antonio66
Contributor III

Hi,

I show you some of the others variables of the module..

pastedImage_0.png

..and the others variables are visible in debug like you can see here..

pastedImage_1.png

.. i also tried to "add global variable" in the debug session and than i tried to "Cast To Type" in debug variable window without success.

0 Kudos