ARM9 STR912 IRQ woes (GCC/Eclipse/OpenOCD)

Hi ppl,

I've been playing with GCC (4.3) (newlib)/Eclipse/OpenOCD to try and ge a timer interupt working. I've managed to see in the VIC0 interrupt status registers that the interrupt flag for timer0 is set on a "TOF" (timer overflow) of the timer.

The problem is that the CPU doesn't branch to execute my interrupt servic routine. Placing a breakpoint in the startup code at 'LDR PC, [PC #-0x0FF0] doesn't get hit at all.

Can anybody please give me some pointers on what else to look at t determine why the interrupt isn't executed?

Regards,

-Frikkie Thirion

//Startup code snippet: Vectors: LDR PC, Reset_Addr /* 0x0000 */ LDR PC, Undef_Addr /* 0x0004 */ LDR PC, SWI_Addr /* 0x0008 */ LDR PC, PAbt_Addr /* 0x000C */ LDR PC, DAbt_Addr /* 0x0010 */ NOP /* 0x0014 Reserved Vector */ LDR PC, [PC, #-0x0FF0] /* Vector from VicVECAddr */ LDR PC, FIQ_Addr /* 0x001C FIQ has no vector! */

Reset_Addr: .word Hard_Reset Undef_Addr: .word Undef_Handler SWI_Addr: .word SWI_Handler PAbt_Addr: .word PAbt_Handler DAbt_Addr: .word DAbt_Handler .word 0 /* Reserved Address */ IRQ_Addr: .word IRQ_Handler FIQ_Addr: .word FIQ_Handler

Undef_Handler: B Undef_Handler SWI_Handler: B SWI_Handler PAbt_Handler: B PAbt_Handler DAbt_Handler: B DAbt_Handler IRQ_Handler: B IRQ_Handler /* should never get here ... */ FIQ_Handler: B FIQ_Handler

In main():

---------- HAL_isr_init(); HAL_isr_init_timer0();

//What is the contents of the interrupt service routine? wI=VIC0->VICx_ISR; if ( (wI&0x10) == 0x10) { wI=0; // Place to put a breakpoint - (This gets hit in GDB) }

HAL_isr_init():

--------------- u32 wI; //Enable SCU clock to peripheral: //Set bit[5] in SCU Peripheral Clock Gating Register 0 wI = SCU->PCGR0; wI |= 0x00000020; //[5] = VIC SCU->PCGR0=wI;

//Take peripheral out or reset: //Set bit[5] in SCU Peripheral Reset Register 0 wI = SCU->PRR0; wI |= 0x00000020; //[5] = VIC SCU->PRR0=wI; //Assign a default function routine to the DVAR, for spurious //interrupts VIC0->VICx_DVAR=(u32)HAL_isr_default_VIC0_isr; VIC1->VICx_DVAR=(u32)HAL_isr_default_VIC1_isr;

HAL_isr_init_timer0()

--------------------- // Interrupt enable: VICx_inter, p118 wI=VIC0->VICx_INTER; wI|=(1VICx_INTSR; wI&=~(1

Reply to
frikkiethirion
Loading thread data ...

Sorry if this is a statement of the obvious, but have you checked that the I bit in the status register is set such that interrupt are globally enabled?

--
Regards,
Richard.

+ http://www.FreeRTOS.org & http://www.FreeRTOS.org/shop
17 official architecture ports, more than 5000 downloads per month.

+ http://www.SafeRTOS.com
Certified by TÜV as meeting the requirements for safety related systems.
Reply to
FreeRTOS.org

Hi Richard

the

I've double checked my startup assembly again and found in the sectio where the stacks are defined that no mention is made about the user mode (never copy and paste example code...).

I've added the following at the bottom of the stack initialization and no everything works ;) # Set up User Mode and set User Mode Stack msr CPSR_c, #Mode_USR mov r13, r0 sub r0, r0, #USR_Stack_Size

Thank you for replying to my post. I was going a bit postal trying t figure out what was going on. Now I can enjoy a quiet evening watching m status LEDs flash to the tune of my timer interrupt ;)

Regards,

-frikkie

Reply to
frikkiethirion

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.