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.

Compiler/TMS320F280049: TI v 16.9.5.LTS

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

hello,

I defined a variable of type int32_t in the CLA2CPU RAM that is used (written) from the CLA. In the expression window this variable is from type int and the shown value is got from the lower 16bits (truncated)!
The calculation in the CLA is OK. The CPU get the full-32 value. Just the display by debugging is wrong. I think the problem is that the variable is seen from the CCS as int and not as long. This is maybe because of the different length of the base-type "int" between CPU and CLA:

#if defined(__TMS320C28XX_CLA__)
    typedef          int    int32_t;
#else
    typedef          long   int32_t;
#endif

Do You have some help/workaround to solve this problem?

I'm using:
- CCS Version 7.2.0.00013
- Compiler TI v 16.9.5.LTS

Thanks a lot, best regards

   Luca

  • Luca Parisi said:
    The calculation in the CLA is OK. The CPU get the full-32 value. Just the display by debugging is wrong. I think the problem is that the variable is seen from the CCS as int and not as long. This is maybe because of the different length of the base-type "int" between CPU and CLA

    Yes I believe you are correct. To avoid these types of issues, it is recommended to use type declarations that include size information (like int32, int16). Could you check that using those types resolves the issue? 

    I also see that the CLA examples in C2000Ware include the F2806x_Cla_typedefs.h where it is recommended to use short/long for 16/32-bit integers. 

  • Hello AartiG,

    I am using the standard data type
    int32_t
    this is defined from compiler in stdin.h in this way:
    #if defined(__TMS320C28XX_CLA__)
        typedef          int    int32_t;
    #else
        typedef          long   int32_t;
    #endif

    What am I doing wrong?
    Where should I include the f28004x_cla_typedefs.h (it doesn't contain the int32_t)

    Thanks and ciao

       Luca

  • Luca,

    I think the C2000 experts are in a better position to answer which include file and data type is recommended to be used when working with CLA, to avoid portability issues.

    Would you mind starting a new post in the C2000 microcontroller forum (and reference this one if you wish)? I could move this thread to the C2000 device forum, but there is a chance of it getting overlooked because of the already ongoing discussion.