This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Interrupt problem ???


Hi Gary,
   I apologize for the poor practices. It's only test code to try to get
something working. In your first comment, if you are referring to the use of
cyg_interrupt_enable(), I did call that function. I forgot to mention it. As for
the vector parameter, is that the interrupt number ?(in my case 40 or 0x28 for
the SCC1 interrupt).

As for masks and other things, they are also being initialized through some more
poor practice. When running ecos, I can read the interrupt being raised in the
sipnr_l register. It looks to me like the interrupts happens but for some
reason, the isr does no get called. Ecos does react to the interrupt. it
actually crash but it does react.

Thanks for you assistance.

Pascal

-----Original Message-----
From: Gary Thomas [mailto:gthomas@ecoscentric.com]
Sent: Thursday, October 03, 2002 9:00 AM
To: Cusson, Pascal
Cc: 'ecos-discuss@sources.redhat.com'
Subject: Re: [ECOS] Interrupt problem ???


On Wed, 2002-10-02 at 17:37, Cusson, Pascal wrote:
> Hi everyone,
>    I am trying to get an interrupt working on a 8260 powerpc. Here is the code
I
> am using:
> 
>  cyg_handle_t *scc1_handler;
>  cyg_interrupt *intr;
> 
> voif init(){
> /*config SCC! interrupt */
>
cyg_interrupt_create(40,0,(cyg_addrword_t)0,isr_scc1,dsr_scc1,scc1_handler,intr)
> ;
> cyg_interrupt_attach(*scc1_handler);
> }
> 
> /* SCC1 interrupt ISR */
> static cyg_uint32 isr_scc1(cyg_vector_t vector,cyg_addrword_t data)
> {
>         cyg_interrupt_acknowledge(vector);
>         return CYG_ISR_CALL_DSR | CYG_ISR_HANDLED;
> }
> 
> /* SCC1 interrupt DSR */
> static void dsr_scc1(cyg_vector_t vector,cyg_ucount32 count,cyg_addrword_t
data)
> {
>         *(USH*)0xf0011a10=0xffff; // Clear SCCE1
> }
> 
> Could anyone please give some pointer on what might be wrong. At this point in
> time, my ISR routine does not get called at all. As soon as my interrupt gets
> generated, eCos goes into error subroutines.
> 

Two major comments:

* You don't seem to have enabled this interrupt anywhere.  Just
configuring it and telling eCos how to manage it does not turn
it on.  Also, you'll need to make sure that the SCC1 is enabled
for such interrupts.

* The line above "*(USH*)..." is really poor practice.  You should be
using the appropriate HAL functions to enable/clear interrupt sources.


-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]