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.

TMS570LS3137-EP: CCS10 debug issue

Part Number: TMS570LS3137-EP
Other Parts Discussed in Thread: TMS570LS3137

We are using TMS570ls3137 in our project and development tool is Code Composer Studio Version: 10.2.0.00009, compiler version is TI v29.2.4 LTS. 

Problem scenario:

Test.cmd:

-----------------------

Temp= 0x00008000;

Temp.h:

-----------------------

typedef struct

{

      int a;

     int b;

}Temp_Struct;

extern const Temp_Struct* const Temp;

Temp.c

------------

int x,y;

extern const Temp_Struct* const Local_Temp;

Local_Temp = Temp;

x = Temp->a;

y = Local_Temp->a;

In above code, when I try to explore structure "Temp" via expression window  it fails load data and it showing "Temp" data type as (void*). If I type cast explicitly in the expression window also it fails to fetch the data. However local instance "Local_Temp" working as expected. could you please clarify me the doubt.

  • When you define something in the linker command file, you are actually defining an address. If you want  define a two int structure that is located in the memory map at a location defined in the link command file, try this:

    /* USER CODE BEGIN (2) */
    typedef struct
    {
         int a;
         int b;
    }Temp_Struct;
    
    extern const Temp_Struct Temp;
    
    /* USER CODE END */
    
    int main(void)
    {
    /* USER CODE BEGIN (3) */
        int x,y;
        x = Temp.a;
        y = Temp.b;
        printf("x = %d, y = %d\n", x, y);
    /* USER CODE END */
    
        return 0;
    }
    

  • The above suggestion is not working for us, still the data type shows in expression window as void*, however we didn't see this issue in Code Composer Studio Version: 6.0.1.00040, compiler version TI v5.1.6. This issue we are encountering only in Code Composer Studio Version: 10.2.0.00009,  compiler version is TI v20.2.4 LTS.

    This issue is observed in all data types,

    Temp.cmd:

    test = 0x0803B000;

    Temp.h:

     extern UINT32* test;

    Temp.c:

    UINT32* test_local;

    test_local = test;

    In the above code the pointer "test" data type shows as void* instead of UINT32*. But the same code working as expected in Code Composer Studio Version: 6.0.1.00040, compiler version TI v5.1.6. As we are migrating to CCS10.2 we wanted to resolve this issue.

     

  • Here is the project from CCs 10.2 using compiler version 20.2.4. Import this into your workspace and verify that you get the following output:

    [CortexR4] x = -1, y = -1
    Hello World!

    /cfs-file/__key/communityserver-discussions-components-files/908/LinkerPointer.zip

  • I have flashed attached project in my MCU, still the issue is persist, the data type for the "temp" shown in Expression window as void* instead of "Temp_Struct". I have attached the snapshot for your reference,

  • This is because the only thing you can define in the link command file is a void pointer. If you need the structure definition in the expression window you can copy the address to a pointer to that type of structure like this:

    /* USER CODE BEGIN (2) */
    typedef struct
    {
         int a;
         int b;
    }Temp_Struct;
    
    extern const Temp_Struct Temp;
    const Temp_Struct *sPtr = &Temp;
    
    /* USER CODE END */
    
    int main(void)
    {
    /* USER CODE BEGIN (3) */
        int x,y;
    
        x = sPtr->a;
        y = sPtr->b;
        printf("x = %d, y = %d\n", x, y);
    /* USER CODE END */
    
        return 0;
    }