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 ???


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]