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.

exit() function in Code Composer 3.1



I am running a TMS320C31 using an old version of code composer, Version 3.1

We are experiencing sudden halts and resets of the processor that I cannot explain.

I noticed that the exit() function is compiled into the software and am wondering if this could be the culprit even though we are not calling it directly. 

I have seen it pop up once or twice in the emulator and suspect it is being called by one of the built in functions.

Which built in functions use the exit function()?

How can I edit the exit() function to change its behavior?

Thank you.

  • The version of Code Composer you are using is indeed very old (btw, is it CC3.1 or 4.1?) and I cannot tell for certain if it worked the same way as the current versions of Code Composer Studio, but in the current debuggers, there is an implicit breakpoint set for end of program and the debugger will halt there when the program finishes.

    The exit function is part of the C runtimes so I would expect it to be linked in if you linked in the rts runtime library.
    Do you see the code halt at the C$$EXIT symbol every time or does it halt randonly at other places?

    In newer versions of CCS, there is a setting to disable the use of the end of program breakpoint to tell the debugger to not halt at end of program (it is usually under a menu item to customize debug options)There might be something similar in the older Code Composer. If this breakpoint is disabled, when the program ends, it will just loop forever instead of halting. 

  • We are using CC3.1.  We would like to go to a newer version however re-qualification costs prevent us from doing that.

    The exit() function is linked in the runtime library.  We are trying to get a unit to halt in the lab to see exactly what happens.  Right now what happens is that the software loops forever when the exit() function is called. 

    We would like to change this so that we either attempt to recover or restart.  Looping forever triggers a watchdog timer which triggers an undesired fault.

    I have looked in the options and the debugger documentation for exit() settings and have found none.  Library documentation states that we can modify the exit() function behavior but does not state how to do this.  Can we re-define exit() in our code and the compiler will link in our code instead of the library?