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

Forum related to ERIKA Enterprise and RT-Druid version 3

Moderator: paolo.gai

Post Reply
Dharma
Newbie
Posts: 2
Joined: Fri Jul 26, 2019 6:57 am

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

Post by Dharma » Fri Jul 26, 2019 9:59 am

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 ..!

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

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

Post by e.guidieri » Fri Jul 26, 2019 10:27 am

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

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

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

Post by paolo.gai » Fri Jul 26, 2019 10:35 am

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

Post Reply