Catching Interrupts

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Tue Oct 12 14:06:53 UTC 2004


Thomas Doerfler wrote:
> Hello Mark,
> 
> I don't know about the MIPS architecture, but I am 
> quite sure you should NEVER call I/O functions from 
> within an ISR.

Definitely.  It can lock the system up very quickly as
one of my class examples demonstrates. :)

Set a variable to indicate the interrupt occurred and
check that at the task level while debugging.

On the MIPS, there is CPU model specific vectoring
code since the interrupt pending bits are encoded
in a CPU Model dependent manner.  It is possible that
there is an AU1100 issue there so read the code
over in libcpu/mips/... related to vectoring interrupts
just be be sure it is doing the right thing.

--joel

> wkr,
> Thomas.
> 
> 
> 
>>I am attempting to write a response to an interrupt
>>under RTEMS for the MIPS AU1100.  I must be missing
>>something, though, as the handler is never called.  I
>>register the handler as follows:
>>
>>   rtems_isr_entry old_entry;
>>
>>   rtems_status_code status;
>>
>>   status =
>>rtems_interrupt_catch(spi_isr,4,&old_entry); //4 is
>>the SSI0 vector on the AU1100
>>
>>   if (status != RTEMS_SUCCESSFUL) {
>>      //handle error
>>   }
>>
>>   *(unsigned int*)(0xB16000008) = 0x00000002;
>>//enable the “done” interrupt
>> 
>>
>>This routine returns an RTEMS_SUCCESSFUL.  The
>>function is as below:
>>
>>
>>rtems_isr spi_isr(rtems_vector_number vector) { 
>>
>>   puts("spi_isr");
>>   *(unsigned int*)(0xB16000004) = 0x0000000E; //clear
>>interrupts
>>}
>>
>>This function is never called, even though polling the
>>interrupt register shows that it should be.  Any
>>ideas?
>>
>>Thanks!
>>
>>Mark
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam protection around 
>>http://mail.yahoo.com 
> 
> 
> --------------------------------------------
> IMD Ingenieurbuero fuer Microcomputertechnik
> Thomas Doerfler           Herbststrasse 8
> D-82178 Puchheim          Germany
> email:    Thomas.Doerfler at imd-systems.de
> PGP public key available at: http://www.imd-
> systems.de/pgp_keys.htm
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list