This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

rtx rtos delay

Dear All,
I am using STM32F373 with Keil RTX RTOS. There are a few tasks being created. all are at the same priority level. tick time is 1ms. most of the time these tasks are not active, only checking flags. if one of the flag is set, then it will start to do processing.
when the processing is complete, the task will be back to checking flag(global variable).
This works fine.

However, when one of the task is kept busy by setting the flag for that task, something weird happens. Observing from the "RTX Tasks and System" window, this task has its "Delay" being changed to a large random number.

The task is being set to 1ms interval, using:

        os_itv_set(1);  // 1tick of 1ms
        for (;;) {
                os_itv_wait ();

                if(Flag){
                   // do some processing
                }
        }

Initially, when the Flag is set, it will be processing normally until about 49 seconds or 50 seconds. Then, this task will not continue running. From the watch window, the Flag is still set, but the task's state is in WAIT_ITV and the Delay becomes randomly large, e.g. 31467 or around this magnitude. When this happens, the task would not execute for about 32 seconds. after which, the task will resume the processing.
This cycle repeats itself.

There is no os_dly_wait() being used here. only the os_itv_wait() is being used.

Hope that anybody can shed some light or direction on why the Delay which was set using os_itv_set() is being changed after some duration. Do check with me for any further details needed.

Best Regards