OS_ERR_INTERRUPT_DISABLE when using OS_Delay

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

  • OS_ERR_INTERRUPT_DISABLE when using OS_Delay

    Hi,
    I m using EmbOs 3.52a and sometime the OS stop and report the error code 154 OS_ERR_INTERRUPT_DISABLE.
    This error happen on the use of OS_Delay and I dont know why?

    Any idea ?

    Thanks.
  • Hello,

    this error code is reported when you call OS_Delay() or OS_DelayUntil() with task switch and interrupts disabled.
    For example the following code produces the error:

    C Source Code

    1. static void HPTask(void) {
    2. while (1) {
    3. OS_EnterRegion();
    4. OS_IncDI();
    5. OS_Delay (50);
    6. }
    7. }


    The error code is reported because when you disable task switch and interrupts the OS_Delay() function will never return (no systick interrupt is running any more) and no other task can run.

    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.
  • OS_ERR_INTERRUPT_DISABLE when using OS_Delay

    Hello,

    Thanks for the reply, I tried to find where interupt are disable, but I have found nothing.
    I try to force the interupt to be enable, like this :

    OS_EI();
    OS_Delay(150);
    But I still having the error 154, sometime.

    Regards.
  • Hello,

    which embOS do you use? Which CPU/Compiler?
    Do you use one of our start projects or your own 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.