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.

xdc_UInt32 Typedef

Other Parts Discussed in Thread: TMS320F2809

Hi,

   It confused me about the xdc_UInt16 and xdc_UInt32 defines

in "std.h"

typedef       unsigned short   xdc_UInt16;

typedef       unsigned int   xdc_UInt32;

But for F28x, unsigned int is a 16bits word, and unsigned long is 32bits, just like defined in "DSP280x_Device.h"

in "DSP280x_Device.h"

typedef       unsigned int       Uint16;

typedef       unsigned long      Uint32;

    Here is my question: is xdc_UInt32 a 16bits word even for F28x device ? Or there have some configuration to solve this conflict ?

 thanks

 

  • If you are referring to lines 108 and 110 in xdc/std.h, please read a comment above that explains that these definitions are not actually used. For 28x, the real definitions are in ti/targets/std.h and these types are defined as
    typedef uint_least16_t  xdc_UInt16;
    typedef uint_least32_t  xdc_UInt32;

    Then, stdint.h defines uint_least16_t as unsigned short, which is of the same size as unsigned int on 28x, while uint_least32_t is defined as unsigned long. So, the sizes of xdc_UInt16 and xdc_UInt32 are exactly as you expected them to be.

    Here is the link that talks about types in RTSC in more details: http://rtsc.eclipse.org/cdoc-tip/xdc/package.html#xdoc-sect-3

  • Hi Sasha,

         thank you for your help. in std.h it seems that i have to defined the 'xdc_target_types__'

         I use CCS5.2 and when create a project i choose the device family C2000, TMS320F2809, isn't it enough for my project or i should add '-Dxdc_target_types__=ti/targets/std.h' in Predefined Symbols bymyself. thanks!

    /*
     * 'xdc_target_types__' must be defined to name a target-specific header
     * file (e.g., ti/targets/std.h) that has definitions for the basic types:
     * xdc_Int8, xdc_Int16, ...
     *
     * For example, to build for a target in the ti.targets package you should
     * add the following option to your compiler's command line:
     *    -Dxdc_target_types__=ti/targets/std.h
     */

  • If you are working in a standard CCS project with a config script you don't have to specify anything extra to get the right type definitions. Everything is done automatically. You should check the content of the file Debug/configPkg/compiler.opt in your project directory. That file should contain -Dxdc_target_types__ macro.