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/TMS320C6657: What's the macro flag for C6657 in CCS

Part Number: TMS320C6657

Tool/software: Code Composer Studio

In some CCS example projects, I saw "#if defined(_TMS320C6400)" or "#if defined(_TMS320C6740)" , but I'm looking for a macro flag for TMS320C6657 so that I can do "#if defined(_TMS320C6657)" in my code.

May I know the name of the flag for C6657, and where can I find it?

Thanks.

  • Hello,

    Often times that flag is defined in the project build properties. You can define one yourself with the --define build option:

    Thanks

    ki

  • Hello!

    If I got your objective right, you are trying to get preprocessor macro matching exactly your device rather than device family. Simple answer - there is no such a macro. Refer to clause 2.6.1. Predefined Macro Names in Compiler user guide. You'll find there

    _TMS320C6X Always defined
    _TMS320C6200 Defined if target is C6200
    _TMS320C6400 Defined if target is C6400, C6400+, C6740, or C6600
    _TMS320C6400_PLUS Defined if target is C6400+, C6740, or C6600
    _TMS320C6600 Defined if target is C6600
    _TMS320C6700 Defined if target is C6700, C6700+, C6740, or C6600
    _TMS320C6700_PLUS Defined if target is C6700+, C6740, or C6600
    _TMS320C6740 Defined if target is C6740 or C6600
    _ _TMS320C6X_ _ Always defined for use as alternate name for _TMS320C6x

    As you see, those define only families, not devices.

    If you badly need to discriminate against exact device, then you'll have to define your own macro as Ki-Soo Lee explained.

    Hope that helps.

  • Thanks for the table.
    So for the C6657 device, which preprocessor macro in the table should we use? _TMS320C6600?
  • To the best of my knowledge, one have to define target --silicon_revision or equivalent -mv option to let compiler handle the code in the best way for device under consideration. In Compiler User Guide, clause 2.3.5. Selecting Target CPU Version (--silicon_version Option) they describe this option on somewhat misleading way. Examples show it is possible to define target processor as -mv6412, that is, specify exactly your part. However, there is no valid option for different Keystones, and the only one you have is -mv6600.

    Next, when you define silicon version, then compiler will have matching macro name defined. Assuming you specified -mv6600, then you will have _TMS320C6600 defined. However, as you might noticed from the previous table, besides _TMS320C6600 you will have _TMS320C6400, _TMS320C6400_PLUS, _TMS320C6700, and _TMS320C6740 defined as well. Thus, checking for _TMS320C6600 one can tell for sure device is Keystone. However, checking for _TMS320C6400 one cannot tell is that any of C64x family or Keystone, and, I think, nested #if->#elif check would do the job.

    Hope that helps.