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.

RTOS: Sys/Bios Exit help

Tool/software: TI-RTOS

Hi,

We are trying to exit "gracefully" from sys/bios - making sure all threads, and other system resources (including HW interrupts) that were set by sys/bios shall be terminated.

We call BIOS_start() in main() to start sys/bios and on some thread upon some condition we want to terminate sys/bios and everything it set up, and we we want to get back to main right after the call to BIOS_start() and perform some more operations .

We have tried calling BIOS_exit() hoping we will get back to main after all threads and resources were terminated but it did not seem to work (looking at ROV all resources seem operational) - we did not get back to main().

then we tried registering a callback function using System_atexit(func). and after the call the BIOS_exit() func was indeed called but resources and threads did not seem to terminate and we never reach back to main().

Can you please help us configure it correctly so we will be able to terminate sys/bios properly and get back to main()

  • Hi Guy,

    You cannot get back to main(). Among various reasons why you cannot is that the stack for main is re-used for the Hwi stack, so all local variables are gone.

    Todd
  • Hi, Thanks.
    If i cannot get back to main() then he only option left is to register the callback function for bios_exit but after reaching this function it still did not seem like all threads and resources were terminated.
    I need to be able to branch to a new program which start sys/bios of its own including network stack, and there may be conflicts (specially with HW resources -i.e. NDK did not start properly again after bios exit and restart sys/bios) if the previous evocation of sys/bios and its resources are not terminated before starting a new one .

    I will be helpful for advice on how to make it shut down (and restart) properly.

    Thanks