Page 1 of 1

Problem in scheduling the tasks(event 1 and event 3).

Posted: Fri Jul 26, 2019 9:59 am
by Dharma
Hi all,
I'm working with the ERIKA v3 with infineon for my application in which i need to schedule interrupt(hardware) oriented event triggered task (say Event 2) along with the default event triggered task (led blinking task Event 1).

I've activated both the tasks in TASK(IFX_OSTASK_INIT)
ActivateTask(IFX_OSTASK_EVENT1);
ActivateTask(IFX_OSTASK_EVENT2);

The set event API Ifx_OSTask_SetEvent (IFX_OSTASK_EVENT1, 1); for led blinking is called inside the IFX_INTERRUPT_CATEGORY2(Ifx_OSTask_BlinkLedIsr,0,11) function. I'm calling the set event API for event 2 from interrupt routine (only when the switch is pressed).

After reset
The led is blinking with 50ms delay until interrupt is ocurred, once when i press the interrupt switch the ISR which i've define inside the event 2 gets performed and the loop gets stuck before the Ifx_OSTask_WaitEvent ( 2 ); in task (event2), ultimately total system get hang.

can anyone help to overcome this ?
Thanks in advance ..!

Re: Problem in scheduling the tasks(event 1 and event 3).

Posted: Fri Jul 26, 2019 10:27 am
by e.guidieri
Hi, a couple of thing:

1) Be aware that you should use the EVENT macro for events if you configured them with the MASK=AUTO option,

if in your oil file have the EVENT declared like this:

Code: Select all

EVENT ExampleEvent1 { MASK=AUTO; };
in the code you should use:

Code: Select all

Ifx_OSTask_SetEvent (IFX_OSTASK_EVENT1, ExampleEvent1);
By the way IFX_OSTASK_EVENT1 is the most misleading name for a TASK that I never seen.

2) I'm quite sure you didn't configured correctly interrupt vectors. Hint it has to be done with OIL file. Read this thread
viewtopic.php?f=12&t=1266&sid=ca06d899a ... d681b8f389

And be sure to use the start-up code from erika lib or customize your startup code to setup ERIKA interrupt vector (or vectors in case of multicore)).

Regards,

Errico

Re: Problem in scheduling the tasks(event 1 and event 3).

Posted: Fri Jul 26, 2019 10:35 am
by paolo.gai
When you say IFX_* it seems that it is some demo delivered by Infineon. Maybe it is better to ask them for an advice?

or try to start from the ERIKA3 demos we distribute...

PJ