ERIKA Timing behaviour

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
kanch
Newbie
Posts: 5
Joined: Mon Nov 05, 2018 8:30 am

ERIKA Timing behaviour

Post by kanch » 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

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: ERIKA Timing behaviour

Post by e.guidieri » Wed Dec 19, 2018 3:35 pm

Hi,

The behaviour you are describing is possible only if the interrupt of the timer in not correctly configured as ISR2, so the TASK tied to an alarm is wrongly executed in the ISR context, and the driver re-arming code is executed after the IncrementCounter/ActivateTask that originated the scheduling.

Since we didn't do integrationtion with iLLD but was Infineon by it self to do that, you have to ask them wich is the right procedure to configure the ISR2.

Errico

Post Reply