This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432E411Y: Expressions view shows wrong values

Part Number: MSP432E411Y

Tool/software: Code Composer Studio

Dear TI experts,

for I couple of CCS versions I had the impression, that some values in the debug perspective's expressions view were wrong. Now I updated to version 10.0.0.00010, but the problem is still the same. The displayed value is wrong and it changes from time to time (becomes yellow highlighted). Thus I had a look on the variables in the memory browser. In the memory browser the bytes do not change (as I expect) and they represent exactly the value I expect:

The variables making trouble are most often dFactor and beActive, but also pFactor and iFactor less frequent.

As you can see in the memory browser the bytes corresponding to dFactor are not aligned and represent a value of 5.25128235e-05 (according to matlab). They do NOT change over time.

For array index 0 dFactor is at 0x2000C3D8 (aligned) and correcty displayed as 5.25128235e-05.

Could you solve this annoying bug?

If you need any more information please let me know.

  • Hello Sven,

    Sven Probst said:
    The displayed value is wrong and it changes from time to time (becomes yellow highlighted).

    The yellow would indicate that the value has changed since last refresh. Does this happen when you are halted? Is continuous refresh enabled like it is in the memory browser view?

    Can you try disabling continuous refresh in both the views and then do a manual refresh? Do the values between the two views match?

    Thanks

    ki

  • Hello Ki,

    I added my answers into you text below:

    "The yellow would indicate that the value has changed since last refresh. Does this happen when you are halted?" Yes.

    "Is continuous refresh enabled like it is in the memory browser view?" Yes.

    "Can you try disabling continuous refresh in both the views and then do a manual refresh? Do the values between the two views match?" No. Memory Browser is OK, expression view wrong.

  • Sven Probst said:
    "Can you try disabling continuous refresh in both the views and then do a manual refresh? Do the values between the two views match?" No. Memory Browser is OK, expression view wrong.

    Thank you for trying.

    I cannot reproduce the problem. The memory browser view and the expressions view are showing the correct value. Can you provide a reproducible test case? I don't need your actual application, something stripped down to just demonstrate the issue is all I need... the simpler the better. I would need the source and executable that I can load. to my MSP432E target

    Thank you

    ki

  • Hello Ki,

    I analysed things further. I seems, that most of the time the wrong addresses get translated:

    pFactor is actually 2.0 at address 0x2000C6A1 ... 0x2000C6A4.

    The displayed value is 2.26562548. This translates on little endian to 02 00 11 40 (bytes in hex notation).

    You can find those values in memory next to the correct values. From time to time the correct value gets displayed. (While the processor is halted in a breakpoint.)

  • Hello Ki,

    maybe my previous post can help you in finding the bug. I'll try to get a small application enabling you to reproduce the issue. But I'm quite busy and it could take a few days. I already added the definition of the variable ovenML_Objects. Maybe you could try to reproduce on your own in the meantime?

    The important thing seems to be that the structure is packed. The declaration is:

    #define OVEN_ML_LIM_CNT     6
    
    typedef struct __attribute__((__packed__)) dataStoreParamDef_s
    {
        /* combined 12 bit of parameter ID and 4 bit of address offset */
        uint16_t paramIdAndAdrOfsLo;
        uint8_t adrOfsHi;
        /* explicit uint8_t */
        uint8_t dataType;
    } dataStoreParamDef_t;
    
    
    typedef struct dataStoreSupport_s
    {
        const dataStoreParamDef_t *paramDeclarations;
        uint16_t moduleId;
        uint16_t numberOfBytesParams;
        uint16_t numberOfParameters;
        uint8_t const *referenceAddress;
        uint16_t categoryAdrOffsets[4];
    } dataStoreSupport_t;
    
    typedef void ((*CallbackFcnPtr_t)(UArg));
    
    typedef struct callbackDefineStruct
    {
        /* pointer to next entry in linked list, set by callback register function, not to be used by user */
        struct callbackDefineStruct *nextEntryPtr;
        /* function pointer to callback function */
        CallbackFcnPtr_t callback;
        UArg callbackArg;
    } callbackDefine_t;
    
    
    typedef struct __attribute__((__packed__)) OvenML_DataPersistent_s
    {
        uint8_t persistentStoreVersion;
        uint8_t  ovenType;
        uint16_t fillOrReserve;
        float limits[OVEN_ML_LIM_CNT];
        float Tpolynomial[4];
        float T_target;
        float workingPoint;
        float pFactor;
        float iFactor;
        float dFactor;
        uint8_t beActive;
        uint8_t hardwareDetectionMode;
        uint8_t connectorId;
        uint8_t severityLevels[OVEN_ML_LIM_CNT/2];
    } OvenML_DataPersistent_t;
    
    typedef struct __attribute__((__packed__)) OvenML_DataPeriodical_s
    {
        float T_current;
        float ctrlOutput;
        float iAccumulator;
        uint8_t controlMode;
    } OvenML_DataPeriodical_t;
    
    typedef struct __attribute__((__packed__)) OvenML_DataOnce_s
    {
        uint8_t hardwareDetectionUsed;
        bool isPresent;
    } OvenML_DataOnce_t;
    
    typedef struct pidMemoryStruct{
        float prevError;
        int_fast8_t outputSaturation; // -1 lower end reached, 1 upper end reached
    } pidMemory_t;
    
    
    /* structure of oven instance variables */
    typedef struct OvenML_Struct
    {
        volatile uint8_t InitState;
        uint32_t systemCallDefine[2];
    
        PWM_Handle pwm_handle;
        uint8_t adcInput;
        uint32_t pmatHandle;
        uint8_t moduleId;
        /* callback definition structure */
        callbackDefine_t callbackDefinition;
        dataStoreSupport_t dS_Support;
        UArg dS_Hdl;
        pidMemory_t tCtrlMem;
        bool hasInvalidParameters;
        bool isControllerOn;
        bool isPMAT_ok;
        float TargetTemperaturePrev;
        float workingPointPrev;
        OvenML_DataPeriodical_t prdcD;
        OvenML_DataPersistent_t prstD;
        OvenML_DataOnce_t onceD;
    } ovenML_Object;
    
    static ovenML_Object ovenML_Objects[6];
    

  • Thank you for the extra information. However, I still see that the expressions view and the memory browser matching up correctly:

    If you can provide a simple test case, that would be very helpful.

    Thank you

    ki

  • Hello Ki,

    thank you for your quick testing and good support. As I can see in your screenshot pFactor is on an even address while in my case it is on an odd. Maybe you could change "fillOrReserve" to uint8_t, such that all variables move.

    In our current software (it is changing very rapidly at this time) ovenML_Objects[0] is at 0x2000C4D8. Maybe you could bring it to the same address in your code. Then pFactor should be on address 0x2000C571. If it is not I probably made a mistake when replacing our custom data types by standard types.

    Could you check?

  • Sven Probst said:
    As I can see in your screenshot pFactor is on an even address while in my case it is on an odd. Maybe you could change "fillOrReserve" to uint8_t, such that all variables move.

    Yes this seems to be the root cause. Thank you for pointing this out. I now see some odd discrepancies along the lines of what you have experienced. I will need to investigate further. 

  • I filed a bug for this issue. The tracking link is: https://sir.ext.ti.com/jira/browse/EXT_EP-9773

    Thanks

    ki