embOS error " OS_ERR_ILLEGAL_OUT_ISR" (no. 162)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • embOS error " OS_ERR_ILLEGAL_OUT_ISR" (no. 162)

    I use microcontroller STR911FA(ARM966E-S) for my application. In this phase of developing emedded system I get during debugging embOS error no. 162 continually. What did I do wrong, where to start searching ? I know that this error is related with embOS timer interrupt(system) and function OS_HandleTick inside of it. But before entering, every interrupt routine embOS is inormed with OS_EnterInterrupt() command (in function OS_irq_handler). This applys for system(embOS timer) interrupt also. But why then this error appears ?
  • Hello Tucepi,

    There are some functions which are only allowed to be called from within an interrupt function.
    These functions are:

    OS_OnTx()
    OS_TICK_Handle()
    OS_TICK_HandleEx()

    Please note that OS_HandleTick is just a define for OS_TICK_Handle, OS_HandleTick is obsolet.

    So please check if you call one of this functions from outside an interrupt routine. Do you have this problem already with the
    embOS start project?

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • embOS error no. 162

    Hello Til,

    Thank you for the answer. I use embOS 3.60 (rev 0) and there is this function OS_HandleTick inside of embOS Timer interrupt rutine _OS_ISR_Tick(). At the beginning (in the start project) this error didn't appear. I also thought that somwhere outside the interrupt routine this function or it's extended version were called but this isn't the case. I don't use embOSview so OS_OnTx also isn't the reason. But if calling this function outside interrupt routine is only thing that can cause this error(I did see that only this functions have OS_ASSERT_INT() call) I will do some more search.
  • Hello Tucepi,

    You should try to find out which function causes the OS_Error. The first way is to look at the call stack and the second one is to set with your debugger the variable OS_Status to 0 and step through your code. This will ends the while loop in OS_Error() and you will step into the function which has called OS_Error().

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.