ERIKA Timing behaviour
Posted: Wed Dec 19, 2018 10:15 am
Hi,
I am using Erika OS in my Aurix application. i have couple of doubts :
1. i have a task of 100ms which should ideally get scheduled in 100ms. to verify this i am using CPU_CCNT to get the ticks count and from that i decide if it is running on 100ms exactly. when i simply run this task without other functions defined in it i get 100.36200ms which is approximately 100ms. but when i run the same task with a function defined in it , it takes additional time same as the time taken by the function. E.g:
/******************** without function*****************************/
TASK(IFX_OSTASK_100MS)
{
//ticks are counted here = 10036200
}
/**********************with function*****************/
TASK(IFX_OSTASK_100MS)
{
//ticks are counted here = 13574144 (135.74 msec)
function() //which requires 35ms for execution
}
if execution time for function is changed corresponding additional value gets added to 10036200 i.e ticks without any function.
why is the execution time of function is getting added even though my task is of 100ms.
configuration for 100ms task is:
MSIZE = 10
MSTART = 4
OS_TICKS_IN_SECONDS = 0.0001 /*minimum timing generation is 100usec*/
SetRelAlarm(IFX_OSTASK_ALARM_100MS,200,400);
/***************oil file configuration for 100msec task*****************************/
TASK IFX_OSTASK_100MS
{
PRIORITY = 2;
ACTIVATION = 1;
AUTOSTART = FALSE;
SCHEDULE = FULL;
STACK = SHARED;
};
2. i had run the same task for 100 iteration then i should get time as 10sec on my stopwatch. but what i am getting is 5sec.
can anyone guide me why i am getting this half time than expected?
3. My 100ms task should compulsorily get scheduled after 100ms no matter how many functions are defined in the task.
how ill be able to get this resolved?(PS:execution time for function is less than 100ms)
4. can anyone guide me through Erika's behaviour with respect to my timing requirements
I am using Erika OS in my Aurix application. i have couple of doubts :
1. i have a task of 100ms which should ideally get scheduled in 100ms. to verify this i am using CPU_CCNT to get the ticks count and from that i decide if it is running on 100ms exactly. when i simply run this task without other functions defined in it i get 100.36200ms which is approximately 100ms. but when i run the same task with a function defined in it , it takes additional time same as the time taken by the function. E.g:
/******************** without function*****************************/
TASK(IFX_OSTASK_100MS)
{
//ticks are counted here = 10036200
}
/**********************with function*****************/
TASK(IFX_OSTASK_100MS)
{
//ticks are counted here = 13574144 (135.74 msec)
function() //which requires 35ms for execution
}
if execution time for function is changed corresponding additional value gets added to 10036200 i.e ticks without any function.
why is the execution time of function is getting added even though my task is of 100ms.
configuration for 100ms task is:
MSIZE = 10
MSTART = 4
OS_TICKS_IN_SECONDS = 0.0001 /*minimum timing generation is 100usec*/
SetRelAlarm(IFX_OSTASK_ALARM_100MS,200,400);
/***************oil file configuration for 100msec task*****************************/
TASK IFX_OSTASK_100MS
{
PRIORITY = 2;
ACTIVATION = 1;
AUTOSTART = FALSE;
SCHEDULE = FULL;
STACK = SHARED;
};
2. i had run the same task for 100 iteration then i should get time as 10sec on my stopwatch. but what i am getting is 5sec.
can anyone guide me why i am getting this half time than expected?
3. My 100ms task should compulsorily get scheduled after 100ms no matter how many functions are defined in the task.
how ill be able to get this resolved?(PS:execution time for function is less than 100ms)
4. can anyone guide me through Erika's behaviour with respect to my timing requirements