Tuesday, May 22nd 2018, 2:00pm UTC+2

You are not logged in.

  • Login
  • Register

DSAAA

Beginner

Date of registration: May 22nd 2008

Posts: 8

1

Wednesday, October 5th 2011, 4:32pm

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.

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 271

2

Wednesday, October 5th 2011, 6:41pm

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/C++ Source code

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


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

DSAAA

Beginner

Date of registration: May 22nd 2008

Posts: 8

3

Tuesday, October 25th 2011, 10:49am

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.

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 271

4

Tuesday, October 25th 2011, 2:31pm

Hello,

which embOS do you use? Which CPU/Compiler?
Do you use one of our start projects or your own project?

Regards,
Til