Re: Aurix ERU sample code

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
chadpham75
Level 1
Level 1
10 sign-ins 5 questions asked 5 replies posted

Dear teoBits,

I followed thru the demo and understand the code and I made the demo work for my dev-Kit TC377tx.

I have one quick question that I hope you can help me and give me some explanations or pointers

My question regarding the MODULE_SRC.SCU.SCUERU[] array for the source selection.  I tried to read more in the manual to understand why the output channel % 4, since we have 8 output channels.  So with  %4 then the source from 3 will match with channel 7? (technically channel 8)?

Where can I find more information regarding the how-to select the SRC_SCUERUx or the details of the register SRC_SCUERUx?

/* Service request configuration */
/* Get source pointer depending on outputChannel (SRC_SCUERU0 for outputChannel0) */
g_ERUconfig.src=&MODULE_SRC.SCU.SCUERU[(int) g_ERUconfig.outputChannel % 4];

0 Likes
1 Solution
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi chadpham,

g_ERUconfig.src=&MODULE_SRC.SCU.SCUERU[(int) g_ERUconfig.outputChannel % 4];

Why %4 in above code line, that's because there is 8 output channels and only 4 interrupt source line.

IfxScuEru_OutputChannel_0 = 0 ,
...
IfxScuEru_OutputChannel_7


So, outputChannel 0-7 will be routed to 0-3 in SCUERU[4]

outputChannel0 - 0
outputChannel1 - 1
outputChannel2 - 2
outputChannel3 - 3
outputChannel4 - 0
outputChannel5 - 1
outputChannel6 - 2
outputChannel7 - 3

 

typedef volatile struct _Ifx_SRC_SCU
{
Ifx_SRC_SRCR SCUERU[4];
/**< \brief 0, SCU ERU Service Request ${x}*/
} Ifx_SRC_SCU;

For SRC_SRCR,  which is a 32bit register for interrupt service.

The ERU_IOUTy outputs are signaled through the ERU_INTy signals to the service request control registers SRC_SCUERUy in the interrupt router module (IR); y=3:0.

dw

View solution in original post

0 Likes
1 Reply
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi chadpham,

g_ERUconfig.src=&MODULE_SRC.SCU.SCUERU[(int) g_ERUconfig.outputChannel % 4];

Why %4 in above code line, that's because there is 8 output channels and only 4 interrupt source line.

IfxScuEru_OutputChannel_0 = 0 ,
...
IfxScuEru_OutputChannel_7


So, outputChannel 0-7 will be routed to 0-3 in SCUERU[4]

outputChannel0 - 0
outputChannel1 - 1
outputChannel2 - 2
outputChannel3 - 3
outputChannel4 - 0
outputChannel5 - 1
outputChannel6 - 2
outputChannel7 - 3

 

typedef volatile struct _Ifx_SRC_SCU
{
Ifx_SRC_SRCR SCUERU[4];
/**< \brief 0, SCU ERU Service Request ${x}*/
} Ifx_SRC_SCU;

For SRC_SRCR,  which is a 32bit register for interrupt service.

The ERU_IOUTy outputs are signaled through the ERU_INTy signals to the service request control registers SRC_SCUERUy in the interrupt router module (IR); y=3:0.

dw

0 Likes