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.

TMS320F280037: Assembly: How to use macros from compiler

Part Number: TMS320F280037

Hi,

in C i could use the macro __TMS320C28XX_VCRC__. I like to use this in assembly file.

When i use it like this:

.if $defined(__TMS320C28XX_VCRC__)

the folling functions are not compilied and i get a error, that they are not found (without the macro check it works).

So How could i use this macro correct or is the name different and which macros are supported from the compiler in assembly.

I use compiler version v22.6.0 LTS

Thanks

David

  • Hi David,

    The appropriate expert for this question is out of office today. Please expect a response back by tomorrow.

    Thank you,

    Luke

  • Hello David,

    I'll support this in place of the other expert.

    the folling functions are not compilied and i get a error, that they are not found (without the macro check it works).

    So How could i use this macro correct or is the name different and which macros are supported from the compiler in assembly.

    I'm not sure why you're using this syntax, this is not how macros are used in C from what I've seen. Below is a snippet of how to use preprocessor definitions/conditionals in C.

    #define LIMIT
    
    //
    //other code
    //
    
    #ifdef LIMIT
    //controlled text
    #endif

  • Hi,

    thank you for your answer.

    Yeah i know how to use macros. But this macro __TMS320C28XX_VCRC__ looks like it is declared by the compiler. Its like ti use the macro __TMS320C28XX_CLA__. I do not find, where it is declared. I think these macros are declared by the compiler.

    Where are these macros declared?

    I like to use the macro __TMS320C28XX_VCRC__ in assembly code, like i write above. I want to expand our crc lib for the uC TMS320F280037, which has a HW CRC, so i like to use the macro in assembly this way:

    .if $defined(__TMS320C28XX_VCRC__)
        ;use hw crc

    The question is how to use this macro __TMS320C28XX_VCRC__ in assembly. In c i could use this macro. When it is not possible to use it in assembly, i have to declare a macro in project predefined settings.

    David

  • Hello David,

    I've not seen the __TMS320C28XX_VCRC__ macro before anywhere, and I can't find it in any of the CCS files relating to the compiler. Was this used in some example or source code somewhere? I don't believe it's something the compiler uses/defines anywhere. If you're just trying to create a similarly used macro as __TMS320C28XX_CLA__, you can refer to this page on how to use macros in assembly.

  • I didn´t remember, where i have see the macro. But i found it in the SPRU513Y in Chapter "8.4.11 Linker Command File Preprocessing"

    Hm, thats only for the linker, so it seems its not usable in assembly file.

    Is there a way to use it in assembly file?

  • Hi David,

    I'm not aware of any way to do this, I will forward this to the compiler team since they're more aware of what gets put into the document you cited.

  • in C i could use the macro __TMS320C28XX_VCRC__. I like to use this in assembly file.

    The assembler predefines symbols that are similar, but not identical.  For the details, please search the C28x assembly tools manual for the sub-chapter titled Predefined Symbolic Constants.

    Thanks and regards,

    -George

  • Thank you very much. This solves it.