LPC2377 Interrupts not firing on RedSuite

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2377 Interrupts not firing on RedSuite

871 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JGold on Mon Aug 05 13:24:59 MST 2013
I am reworking a design I completed years ago.  The previous project was compiled on an eval version of a Keil compiler.  I have transferred this code to my RedSuite version 3.5.  I am able to compile it without errors/warnings.  I can download the code, but the interrupts are not firing.  Especially the Timer0 interrupt. 

Does anyone have example code for running interrupts on an LPC2377 with RedSuite?
Labels (1)
0 Kudos
4 Replies

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JGold on Wed Aug 07 12:24:19 MST 2013
Addendum 2

Since I started this project years ago with Keil uVision 3 (eval version which has timed out), I had the thought of trying a newer version of uVision evaluation.  I installed uVision 4.72.  The code compiles without errors, but the interrupts still do not fire.  Even in the simulator, I can not get a break point in the timer ISR to hit.

The __attribute__ did not work with Keil.  I am having more problems with the Red Suite now, so I can not try it out there.



/************************************************************************/
/* Timer0 IRQ: Executed periodically                                          */
/**/
/************************************************************************/
void T0_IRQHandler (void) __irq
{
unsigned char i;


/***************************  1 millisecond   **************************************/

//LED flash control is on 1 millisecond count
if(LEDA_R_flash_timr)
{
if(--LEDA_R_flash_timr)*LEDA_R_SET = LEDA_R_MASK;
}


T0IR        = 1;                      /* Clear interrupt flag               */
VICVectAddr = 0;                      /* Acknowledge Interrupt              */
}



The simulator shows the VIC set up correctly (as far as I can tell) and the timer shows an interrupt pending, just no ISR executing.



Is there a global interrupt enable flag?


0 Kudos

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Tue Aug 06 07:43:23 MST 2013
Have you tried adding __attribute__ ((interrupt ("IRQ"))) to the function definition?

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

HTH!  :)


0 Kudos

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JGold on Tue Aug 06 05:56:14 MST 2013
Addendum 1

ARM7TDMI
LPC2377

Here is the code for setting up the interrupt:

  /* Setup Timer Counter 0 Interrupt */
  VICVectAddr4 = (unsigned long)T0_IRQHandler;    /* TC0 Interrupt -> Vector 4   */
  VICVectPriority4 = 0x24;
  VICIntEnable = 0x00000010;


void T0_IRQHandler (void)
{
if( radio_wait_timr ) radio_wait_timr--;
if( msec_delay ) msec_delay--;


T0IR        = 0xff;       /* Clear interrupt flag               */
VICVectAddr = 0;          /* Acknowledge Interrupt              */
}


Is there any special compiler directive to show an ISR is an interrupt?
0 Kudos

821 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Aug 06 01:24:59 MST 2013
v3.5 is VERY old. I would recommend that you at least install v3.6.3 (the last v3 release) - which you can install in parallel to your existing v3.5 installation:

http://support.code-red-tech.com/CodeRedWiki/VersionInfo#RedSuite3
http://support.code-red-tech.com/CodeRedWiki/UpdatingNewMinorVersion

And you should probably also try out the latest release - v5.26, which is available under evaluation...

http://support.code-red-tech.com/CodeRedWiki/HowToEvaluate
http://support.code-red-tech.com/CodeRedWiki/UpgradingNewMajorVersion

Regards,
LPCXpresso Support
0 Kudos