My application has one external Interrupt IRQ7 every second (no timer).
A trap occured up to 3 times in a day, in OsIntCtxSw (address 200DEF0 in the map) offset 0x1A (Faulted PC = 0200DF0A)
During three days the same application without IQ7 interrupt had no trap.
I added below the trap text, IRQ code and application tasks.
Could anyone help me, it's the first time I trap in NetBurner asm code.
Thanks,
Trap text:
/---------------------------------------------------------------------------/
/---------------------------------------------------------------------------/
Trap occured
Vector=Access Error FMT =03 SR =2704 FS =0C
Faulted PC = 0200DF0A
D0:00000000 00000030 00000002 00000004 00000007 0200FF8C 00000AA7 02015D90
A0:20000400 00000000 20000530 020161B8 020201B2 02016CF8 0203A018 0203A018
Waiting 2sec to start 'A' to abort
/---------------------------------------------------------------------------/
/---------------------------------------------------------------------------/
The interrupt code is very simple
/**************************************/
/**************************************/
INTERRUPT(ISR_RTC,0x2700)
{
sim.eport.epfr|=0x80;// IRQ7
bIT_RTC=true;
isr_cpt++;
if ((isr_cpt & 0x01)==0)
sim.gpio.podr_timer &= ~PDDR_PODR_DTOUT1; //Set Led to 0
else
{
sim.gpio.podr_timer |= PDDR_PODR_DTOUT1; //Set Led to 1
isr_cpt=1;
}
}
/**************************************/
and the init code is:
SetIntc((long)&ISR_RTC,7,4,4);
/**************************************/
/**************************************/
Application tasks:
- Main task processing I2CMaster, RS232 out on UART0 (Mtty) and UART2
- UDPMulticast task processing commands on I2C , UART and SPI
Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
Re: Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
Odds are that is not where the problem is. Rather, the interrupt code or some other part of your app is causing memory corruption, and the program counter just happens to end up there.
Re: Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
Your problem is due to using a non-maskable (level 7) interrupt with the standard interrupt macro. The standard interrupt macro interacts with the OS which is not allowed for level 7 interrupt routines. There is an explanation and example of how this works in the interrupt application note:
http://www.netburner.com/downloads/mod5 ... rrupts.zip
-Larry
http://www.netburner.com/downloads/mod5 ... rrupts.zip
-Larry
Re: Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
thanks Larry,
But there is a mistake somewhere:
I use IRQ7 but if take a look at my SetInc(.....,7,4,4.) you could see that I use the vector 7 with level and priority to 4.
I made an un-maskable interrupt (0x2700) but the same code with IRQ5 in place of IRQ7 works with no trap, why??
thanks for the link,
Ghislaine
But there is a mistake somewhere:
I use IRQ7 but if take a look at my SetInc(.....,7,4,4.) you could see that I use the vector 7 with level and priority to 4.
I made an un-maskable interrupt (0x2700) but the same code with IRQ5 in place of IRQ7 works with no trap, why??
thanks for the link,
Ghislaine
Re: Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
The external interrupts have no configurable IRQ level or priority. They are fixed to their labeled level... IRQ7 = level 7 and IRQ5 = level 5. The external IRQ pins also have a fixed mid-priority, between prio 3 and 4. This is documented in the eport chapter of the Freescale manuals.
-Larry
-Larry
Re: Trap in OsIntCtxSw on MOD5270 (NNDK 2.2rc2)
Thanks Larry,
I learned something about IRQ7 : it works like NMI!
So I would rather use other interrupts (IRQ1, 3 and 5).
Thank you for the lesson,
Ghislaine
I learned something about IRQ7 : it works like NMI!
So I would rather use other interrupts (IRQ1, 3 and 5).
Thank you for the lesson,
Ghislaine