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.

new update of code composer halt the program with exit.c file



Hello everyone, 

After i upgraded CCS recently, i got the exit.c file opening whenever running a program. i did not set to halt at any process or any breakpoints, but still the problem  is there. 

Hope sne can explain or help me fix this problem. Thanks

  • Does your program use SYS/BIOS (aka TI-RTOS)?

    For SYS/BIOS programs the exit function will be called if an error is detected by SYS/BIOS.

    For a bare-metal program exit will be called if the main function returns.

  • Hi Chester,
    My program is bare-metal program without sys/bios
    This is code for my program, wherever i clicked resume when debugging, exit.c file opened by itself

    //*****************************************************************************
    //
    // MSP432 main.c template - Empty main
    //
    //****************************************************************************

    #include "msp.h"

    void main(void)
    {

    WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
    P1DIR = 0X0020;
    P1OUT = 0X0020;
    }


    **I use void main so there will be no return value.
  • Khanh Nguyen34 said:
    This is code for my program, wherever i clicked resume when debugging, exit.c file opened by itsel

    CCS sets a breakpoint on the exit() function, where exit() will be called if either:

    • The main function returns
    • The program is terminated upon detecting an error (used in SYS/BIOS programs)

    The example program returns from main which explains the behavior. It you make main() run continuously, by adding a continuous loop, then will not stop when you click resume:

    void main(void)
    {
    
        WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
        P1DIR = 0X0020;
        P1OUT = 0X0020;
    
        for (;;)
        {
        }
    }

**Attention** This is a public forum