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.

I get warnings when I try to use ASSERT Macro (using CCS5).

Other Parts Discussed in Thread: TM4C123BH6PM

I'm using CCS5.5 to program Tiva TM4C123BH6PM with XDS100V3 Emluator.

I'm trying to make my own function.

The question is that I want to use ASSERT Macro, but I get warnings.

Which header files have the #define ASSERT ?

+) I have another error about stack.

#10210-D creating ".stack" section with default size of 0x800; use the -stack option to change the default size Project.

What do I have to do..?

  • Hello Min-Ku,

    For ASSERT please include "driverlib/debug.h"

    The second warning message is for the Stack Size. For this right click the project, go to "Show Build Settings" -> Build -> ARM Linker -> Basic. There is a option for overriding the Stack Size already mentioned in the cmd file. You can put the value of 512 (which is 2K Bytes for Stack) and this should remove the second issue.

    Regards

    Amit

  • Hello Amit, and thanks alot!! I found it.

    However I still get warnings about function _error_.

    function "__error__" declared implicitly

    Where is _error_ function?


    #ifndef __DEBUG_H__
    #define __DEBUG_H__

    //*****************************************************************************
    //
    // Prototype for the function that is called when an invalid argument is passed
    // to an API.  This is only used when doing a DEBUG build.
    //
    //*****************************************************************************
    extern void __error__(char *pcFilename, uint32_t ui32Line);

    //*****************************************************************************
    //
    // The ASSERT macro, which does the actual assertion checking.  Typically, this
    // will be for procedure arguments.
    //
    //*****************************************************************************
    #ifdef DEBUG
    #define ASSERT(expr) do                                                       \
                         {                                                        \
                             if(!(expr))                                          \
                             {                                                    \
                                 __error__(__FILE__, __LINE__);                   \
                             }                                                    \
                         }                                                        \
                         while(0)
    #else
    #define ASSERT(expr)
    #endif

    #endif // __DEBUG_H__

  • Hello Min-Ku,

    I created a sample project and it does not give me any warning for ASSERT. Can you check the compiler settings? Or if possible share the CCS project?

    Regards

    Amit

  • Here is my project. (Please don't tease my poor programming skills :) )

    4263.Tiva_Test_LED.zip

  • Hello Min-Ku,

    No problems on the programming part. But as long as you make ammends it would be helpful

    1. The TIAWare is not included. Include this using the Build Settings option.

    2. Add the include "drivelib/debug.h" in GPIO_A_PWM_SET.c

    2. Remove the ASSERT defintion from BIT_DEFINE.h file

    Regards

    Amit