[ECOS] Create interrupt problem

Vikas K. Prasad vikas.prasad@ittiam.com
Tue Oct 5 15:11:00 GMT 2004


Gary,

Yes! I checked it. I have a doubt - it is the bit9 in the
register and the value of reg r4 is 9. Should it be 10 ?

Here are all the register values after the execution of
the instruction previous to 0x41004dc.

r0             0x9      9
r1             0x0      0
r2             0x411ba88        68270728
r3             0x200    512
r4             0x9      9
r5             0x11110005       286326789
r6             0x41054fc        68179196
r7             0x11110007       286326791
r8             0x11110008       286326792
r9             0x411ba88        68270728
r10            0x1111000a       286326794
r11            0x411bb08        68270856
r12            0x41193f0        68260848
sp             0x411502c        68243500
lr             0x41004e0        68158688
pc             0x41004dc        68158684
fps            0x0      0
cpsr           0x93     147

And the value of r6 is location of hal_default_isr().
Thank you for your quick replies and clues...

Regards,
Vikas

-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Tuesday, October 05, 2004 8:20 PM
To: Vikas K. Prasad
Cc: ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Create interrupt problem


On Tue, 2004-10-05 at 08:45, Vikas K. Prasad wrote:
> Gary,
> 
> Oops! The timer1_obj is fine.
> 
> Further, timer1_handle is attached using:
> cyg_interrupt_attach(timer1_handle);
> 
> Note that I did put a break point in hal_IRQ_handler()
> and got the interrupt there (it is unmasked). After
> tracing the same in assembly in function handle_IRQ_or_FIQ(),
> 
>  41004b4:	1a000002 	bne	41004c4 <handle_IRQ_or_FIQ+0xb8>
>  41004b8:	e1a00009 	mov	r0, r9
>  41004bc:	eb002c20 	bl	410b544 <hal_spurious_IRQ>
>  41004c0:	ea000006 	b	41004e0 <spurious_IRQ>
>  41004c4:	e59f10e8 	ldr	r1, [pc, #232]	; 41005b4 <.hal_interrupt_data>
>  41004c8:	e7911104 	ldr	r1, [r1, r4, lsl #2]
>  41004cc:	e59f20dc 	ldr	r2, [pc, #220]	; 41005b0 <.hal_interrupt_handlers>
>  41004d0:	e7926104 	ldr	r6, [r2, r4, lsl #2]

Are you sure r4 has "TIMER1_VECTOR"?

>  41004d4:	e1a02009 	mov	r2, r9
>  41004d8:	e1a0e00f 	mov	lr, pc
>  41004dc:	e1a0f006 	mov	pc, r6
> 
> I am hitting 0x41004d4 with register r6 not containing the
> handler for timer1_isr() but instead it has address of
> hal_default_isr(). I was not able to infer why? 
> What should I look for now ? 
> 
> Regards,
> Vikas
> 
> 
> 
> -----Original Message-----
> From: Gary Thomas [mailto:gary@mlbassoc.com]
> Sent: Tuesday, October 05, 2004 8:04 PM
> To: Vikas K. Prasad
> Cc: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] Create interrupt problem
> 
> 
> On Tue, 2004-10-05 at 08:24, Vikas K. Prasad wrote:
> > Hi,
> > 
> > I was unable to attach an ISR properly.  I am  using a custom
> > board (with excalibur on it) on which the basic ecos features
> > are working and now I am testing the interrupts.
> > 
> > I used the following command:
> > cyg_interrupt_create((cyg_vector_t)TIMER1_VECTOR, /* Vector           */
> >                      (cyg_priority_t)TIMER1_PRI,  /* Priority         */
> >                      TIMER1_DAT,                  /* Interrupt data   */
> >                      (cyg_ISR_t*)timer1_isr,      /* ISR handler      */
> >                      (cyg_DSR_t*)timer1_dsr,      /* DSR handler      */
> >                      &timer1_handle,              /* Interrupt handle */
> >                      &timer1_obj);
> > 
> > With this after execution of the command I see that some
> > junk values are stored in timer1_obj.
> > 
> > (gdb) p/x * (cyg_interrupt*)timer1_obj
> > $16 = {vector = 0xe3a00a40, priority = 0xe3a01880, isr = 0xe0410000,
> >   dsr = 0xe04ff000, data = 0xe1a00000, dsr_count = 0xe59f022c,
> >   next_dsr = 0xe3a01007}
> 
> This command makes no sense.  You told eCos to put the interrupt
> object in 'timer1_obj', but you are asking GDB to use the contents
> of 'timer1_obj' as a pointer.
> 
> You really should write:
>   (gdb) p/x timer1_obj
> 
> > 
> > Because of this, hal_default_isr() is called and my ISR is never
> > hit. Can you please give me some clues as to where the problem
> > lies ? I am suspecting that the ISR routines are not not attached
> > properly. Anything that I need to specifically do in the platform
> > port for this?
> 
> After you created the interrupt, did you attach it?  Did you
> unmask it?  
> 
> Try looking at the myriad of uses of the cyg_interrupt_XXX()
> functions in the eCos code base and read the documentation.
> Just creating an interrupt object does not allow interrupts
> to happen.
> 
> -- 
> Gary Thomas <gary@mlbassoc.com>
> MLB Associates
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list