This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Create interrupt problem
- From: Gary Thomas <gary at mlbassoc dot com>
- To: "Vikas K. Prasad" <vikas dot prasad at ittiam dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Tue, 05 Oct 2004 08:49:59 -0600
- Subject: RE: [ECOS] Create interrupt problem
- Organization: MLB Associates
- References: <45A1F95BB9D7D84FAB0A1EB4D67EEF96B58E08@is01ex01.ittiam.com>
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