darkvegetable wrote on Monday, November 10, 2008:
Well, after a lot of head scratching and debugging I fixed the first crash. Turns out the timer interrupt was firing & I wasn’t handling the IRQ at all
Now I have the IRQ handler setup correctly (LPC2888 is very different to other LPC parts) I have a problem in the vTickISR.
When my interrupt fires I execute the following:
void IRQHandler( void ) __attribute__ ((naked));
void IRQHandler( void )
irq = (INT_VECTOR0 & 0x000000FF) >> 3;
fptr = (FnPtr)Int_Table[irq];
This reads the interrupt cause reg and looks for the ISR in a lookup table. (irq & fptr are global vars since this function is ‘naked’ and local vars don’t work). I then jump to the FreeRTOS vTickISR()
void vTickISR( void ) __attribute__((naked));
void vTickISR( void )
/* Save the context of the interrupted task. */
/* Clear the interrupt source */
T0CLR = 0x0;
/* Restore the context of the new task. */
When I hit that portRESTORE_CONTEXT() I jump into hyperspace (pabt). Is the problem that I have an IRQHandler() function and that is destroying my task context info? If so, can I call SAVE/RESTORE from ARM mode?
All help gratefully received.