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.

TMS320F28377S: Driverlib with .cla Files: __error__ function

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

The debug.h file in the driverlib uses the __error__() function in the ASSERT macro. If this file is included by .c and .cla files, it is not possible to use one single __error__() function because of the different cores calling it. A workaround would be to implement two ASSERT macro for the two compilers. But that would result in a change in driverlib functions, that is not desired.

For example the cla.h file in the driverlib uses the ASSERT macro for both, C28x and CLA compilers.

Do you have any suggestions for that problem without changing the driverlib files?

Thanks in advance,

Steven

  • Hi Steven,

    I believe we already have fixed this issue. The ASSERT macro is defined differently for C28x and CLA.

    This is from C2000ware v4.01.00:

    //
    // When called from C28x application
    //
    #define ASSERT(expr) do                                                       \
                         {                                                        \
                             if(!(expr))                                          \
                             {                                                    \
                                 __error__(__FILE__, __LINE__);                   \
                             }                                                    \
                         }                                                        \
                         while((_Bool)0)
    #else
    //
    // When called from CLA application. Update as needed.
    //
    #define ASSERT(expr) do                                                       \
                         {                                                        \
                             if(!(expr))                                          \
                             {                                                    \
                                 __mdebugstop();                                  \
                             }                                                    \
                         }                                                        \
                         while((_Bool)0)

    Regards,

    Veena