cancel
Showing results for 
Search instead for 
Did you mean: 

SPC5EL60L3 - ivor_exit

alessandro2
Associate III
Posted on February 21, 2017 at 08:51

Hello everyone, I'm working with SPC56EL60L3.

I'm doing some functional testing, and sometimes my application gest stuck.

This morning I found it stuck once again, I took a look using the debugger and I found it was exceuting _ivor_exit (please see the picture below)

0690X00000606LdQAI.png

Looking at the startup code (ivor.s), I found the following code, which looks like the only piece of code related to ivor_exit.

#if (CORE_SUPPORTS_DECREMENTER == 1)

/*

* _IVOR10 handler (Book-E decrementer).

*/

.align 4

.globl _IVOR10

.type _IVOR10, @function

_IVOR10:

/* Creation of the external stack frame (extctx structure).*/

e_stwu sp, -80(sp) /* Size of the extctx structure.*/

e_stmvsrrw 8(sp) /* Saves PC, MSR. */

e_stmvsprw 16(sp) /* Saves CR, LR, CTR, XER. */

e_stmvgprw 32(sp) /* Saves GPR0, GPR3...GPR12. */

/* Reset DIE bit in TSR register.*/

e_lis %r3, 0x0800 /* DIS bit mask. */

mtspr 336, %r3 /* TSR register. */

#ifndef _SPC570Sxx_

/* Restoring pre-IRQ MSR register value.*/

mfSRR1 %r0

/* No preemption, keeping EE disabled.*/

se_bclri %r0, 16 /* EE = bit 16. */

mtMSR %r0

#endif

e_b _ivor_exit

#endif /* CORE_SUPPORTS_DECREMENTER */

Reading the documentation I found IVOR_10 is related to decrementer interrupt.

As far as I understand, decrementer can be used for implementing software timing.

OK, what if I don't need decrementer (and I don't want its interrupt to interfere with my application?).

One more thing:

I found the following sentence on the programmers manual:

''MSR[EE] also enables external input and decrementer interrupts.'' (RM004, page 272)

It looks like whenever I enable interrupts setting the EE flag in MSR register (I use irqIsrEnable(), for this), it also enables decrementer interrupts.

What If I don't want decrementer interruotys to be enabled?

Should I make any changes to irqIsrEnable()?

Thank you.

Regards

Alessandro

1 REPLY 1
Erwan YVIN
ST Employee
Posted on February 23, 2017 at 14:54

Hello Alessandro ,

you should put this compilation switch in FALSE

#if (IRQ_ENABLE_IRQ_PREEMPTION == TRUE)�?�?�?

if you want disable IVOR10 (Decrementer),

youhave not to enable DIE (Decrementer Interrupt enable) in TCR SPR 340

 asm (
 'e_lis %r3, 0x0040 \t
' /* DIE ARE bits. */
 'mtspr 340, %r3' /* TCR register. */
 );�?�?�?�?

Best regards

Erwan