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.

how to exit a DSP/BIOS application



I have a DSP/BIOS application that runs a series of unit test on my code.  I want to run this application on the command line using loadti.  All of the unit test pass.  But the scripting engine times out and throws an error because there is no exit from the application.  I want want the reuslts of the unit tests to determine the result, not the timeout.

I know this is weird because firmware never exits.  But I cannot think of another way to terminate gracefully without the timeout error.  Any ideas?

  • Kurt,

    DSP/BIOS provides two functions for halting program execution: SYS_abort(), which is used for catastrophic circumstances, and SYS_exit(), which is used for normal termination.  You may configure BIOS to invoke your own functions whenever these functions are invoked.  SYS_exit() will call whatever function is bound to it, passing on its original status parameter.  You can also configure a number of handler functions to execute prior to the bound function in order to do system cleanup.

    Dave

  • I am using DSP SYS BIOS 6.3 and i would like to have an abort() as well as an exit() handler for DSP BIOS 6.3 kind of application. 

    I also need to know as to how to handle errors too thro using the userdefined error_handler functions.

    How do i configure the BIOS to invoke my own user defined functions when an abort(), or assert() or an exit() or error occurs. Please kindly help me with this.

     

    Thanks

    Santosh

  • Yes, I tried both SYS_exit() and the SYS_abort().  Unfortunately they did not work right.

    Because of the design I have to call SYS_exit() in a task.  I setup the exit task with a priority of -1 (suspended). I run the unit tests in another task then set the priority of the exit task to 1 before returning.  I can break on the call to TSK_setpri() in the test task and on the call to SYS_exit() in the exit task.  In the dbugger I get a continuous stream of messages, "TMS320C64X+_0: Warning: CPU:Interrupt No. 15 dropped, an earlier interrupt is pending to be taken", and no exit. On the command line I get no exit.

    (if I remove the SYS_exit() call from the exit task then I do not get an error messages)
    (and yes, I set the exit task exitFlag=0 to allow "shutdown while this task is running")

  • Hmmm...

    The last time I saw this error was in the following thread last year.  I wonder if you can address it in the same way?

    http://e2e.ti.com/support/embedded/f/355/p/61893/222048.aspx#222048

  • Hello David,

    Can you pls provide some input and help with regards to my query on examples on System_abort() and System_error() handling for DSP SYS/BIOS 6 as mentioned in the following thread ?

    http://e2e.ti.com/support/embedded/f/355/p/125798/449565.aspx#449565

    It would be of great help.

    Thanks

    Santosh

  • I think we're getting sidetracked here. first by the error messge and second by a hijacker.

    1) I see the "TMS320C64X+_0: Warning: CPU:Interrupt No. 15 dropped,.." message all the time. I think it is some bug in the simulator. this is not really a concern here

    2) can you move that other guy's  posts somewhere else?  really confused why he is posting here...

    my problem remains that something is not working right when I call SYS_exit() from a task. the visible effects are a)  "TMS320C64X+_0: Warning: CPU:Interrupt No. 15 dropped,.." error message, b) the program does not halt.  any ideas?

  • Kurt,

    I already split Santosh's question into a separate thread.

    I agree that the warnings that you are receiving seem to be a red herring.  It's still not clear to me why you are having difficulty using SYS_exit().  The default function that is called by SYS_exit() should be UTL_halt.  If you set a breakpoint on that symbol, do you reach it? Are you doing anything to configure SYS_exit() to execute any of your handlers?  Are you reaching the function SYS_atexit() that would call these handlers?

    Dave

  • I thought I had this working but now its freaking out again.

    I do not have any exit handlers.

    my problem seems to be that SYS_exit calls UTL_halt which spins on one address. but, I need my program to actually exit somehow (i.e. return to the loader). I do not know how this is possible with a DSP/BIOS program since when main() returns the OS starts. 

    how does one "exit" from the DSP/BIOS?

  • Right, UTL_halt is the default function called by SYS_exit().  This serves most users well because it spins there, allowing users to see what's happening in the debugger.  I said that UTL_halt is the default function called.  But you can configure DSP/BIOS to call any function you like.

    SYS_exit will call whatever function is bound to the Exit function property, passing on its original status parameter. SYS_exit will first executes a set of handlers registered through the function SYS_atexit, which looks like:

    (*handler8)(status)
    ...
    (*handler2)(status)
    (*handler1)(status)
    (*(Exit_function))(status)

    This SYS_atexit function provides a mechanism that enables you to stack up to 8 “clean-up” routines, which are executed before SYS_exit calls the function bound to the Exit function property.

  • I think we are getting out there a bit...

    and now I am now feeling a bit foolish - if I would just listen to myself..."how do you 'exit' a DSP/BIOS program?"...i.e. how do you 'exit' a C program?...

    ...you call exit(0)...