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/TMS320F28374D: weak pragma in CCS for C28x

Part Number: TMS320F28374D

Tool/software: Code Composer Studio

HI everybody , 

do we support  pragma WEAK  as defined in GCC  https://en.wikipedia.org/wiki/Weak_symbol  in C28x compiler ?

anything similar ?

I m porting a code from GCC to C28x and any suggestion is welcome 

thank you 

regards

Carlo

  • Hi Carlo,

    The 'weak' pragma is supported with EABI builds from v18.12 of the CG tools.  For more information, see p.133 of the C compiler user's guide, here:

    http://www.ti.com/lit/ug/spru514r/spru514r.pdf

    Regards,

    Richard

  • Hi Richard ,
    great !
    please do we support attribute weak like this :

    void __attribute__((weak)) weak_func(void);

    thank you
    best regards
    Carlo
  • Hi Carlo,

    The __attribute__ form is supported too, however it's a bit more complicated than I thought.

    You'll need to compile in EABI mode to take advantage of weak functions. EABI is supported for all new devices, but I am not sure if F2837x is one of those. Let me ask someone else to comment on that.

    Regards,

    Richard
  • HI Richard
    please I m a little confused , I must stay on F2837xx family .
    I understood for F2837x --> WEAK pragma is OK , while attribute Pragma you need EABI and this is not supported by F2837x ? any news ?
    coudl you kindly confirm ?
    thank you very much
    best regards
    Carlo
  • Hi Carlo,
    I'm very sorry for the delay getting back to you.
    The situation is that weak functions are only supported with EABI. This goes for both the pragma and __attribute__ methods. So, if you want to use weak you have to build with the --abi=eabi compiler setting. Providing you have a version of the CGT which supports EABI, you can build for any C2000 device this way.
    The problem is that the C2000 collateral has not been built with EABI for any currently available device, including F2837x. This means the RTS library, and any other C2000 library you are using, will not support EABI. EABI supoprt will begin on the next roadmap device.
    I think what this means is you are not going to be able to use EABI on this device and therefore can't specify weak functions.
    I'm sorry not to have better news.
    Regards,
    Richard