Erika OS implementing/calling Interrupts

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
amitdey1314
Newbie
Posts: 16
Joined: Tue Mar 22, 2016 6:37 pm

Erika OS implementing/calling Interrupts

Post by amitdey1314 » Mon Apr 04, 2016 8:44 am

Hello,

My Name is Amit Dey. Presently i am working on a Project where i am supposed to make run-time measurements and the long-term goal is to create an environment to evaluate different ways of optimizing a library for multicore processors with the help of characteristic modules.

I am using Aurix Tricore TC297TF BA and Chose Erika Enterprise as the operating System. I started with putting the Evaluation board into Operation and start implementing Task structure which is similar to real ECUs.

At this Point i am in a need to implement Interrupts. I went through all the demo Projects and documentation to get an idea about using an Interrupt. But unfortunately i could not find much help. In the config.oil file i could successfully define the ISR object but i am not getting a clear Picture on how to implement the Interrupt (like calling an ISR, etc) in the main code. I would be very grateful if i could get demo or example guides implementing Interrupts. I looked through the demos but i could not find much help related to my Evaluation board.

Additional Information: I also tried using the APIs like EE_tc2Yx_stm_set_sr1(), EE_tc2Yx_stm_set_sr1_next_match(). But i could not bring them to work.

Could you please assist me regarding this issue?

Thanking in advance.

Regards,

Amit Dey

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

Re: Erika OS implementing/calling Interrupts

Post by e.guidieri » Mon Apr 04, 2016 1:57 pm

Hi Amit Dey,

An ISR is an asynchronous activity which is never called by application code, rather is supposed to be the way around: hardware "interrupts" application code and the "interrupts handler" eventually communicate with application, calling the code...

In any case, once an ISR is configured in the OIL (Aurix Interrupt Handling configuration) and provided the configuration fitting handler in the code:

Code: Select all

ISR isr_1 {
   CATEGORY = 2;
   PRIORITY = 1;
 };

ISR(isr_1) {
  //Handler code
}
You need to configure the Service Request Node (SRN) of the peripheral that you want to get interrupts from. In function
void EE_tc2Yx_stm_set_sr0(EE_UINT32 usec, EE_TYPEISR2PRIO intvec) you can find a SRN configuration for the STM peripheral.

Errico

amitdey1314
Newbie
Posts: 16
Joined: Tue Mar 22, 2016 6:37 pm

Re: Erika OS implementing/calling Interrupts

Post by amitdey1314 » Mon Apr 04, 2016 2:22 pm

Hello Errico,

Thank you so much for your fast reply.

What about Software Interrupt? Or what in case i just want to write a simple Interrupt Service Routine which must be called every 5 seconds and it blinks a particular LED.

Sorry if my question is very obvious. I am very new to this topic.

Thank you in advance.

Regards,

Amit Dey

amitdey1314
Newbie
Posts: 16
Joined: Tue Mar 22, 2016 6:37 pm

Re: Erika OS implementing/calling Interrupts

Post by amitdey1314 » Tue Apr 05, 2016 10:30 am

Also i am facing a Problem where if in the oil file i define Counter Device as STM_SR0, then using EE_tc2Yx_stm_set_sr0() Shows error while compiling (undefined reference ). And if i define Counter Device as STM_SR1, then it Shows error if i use EE_tc2Yx_stm_set_sr1().

Post Reply