interrupt on arm9

xi yang hiyangxi at gmail.com
Thu Oct 25 09:28:56 CDT 2007


2007/10/25, Ray <xr at trasin.net>:
> rtems_interrupt_enable(3) will call the bellowing finally
>
> #define _CPU_ISR_Enable( _level )               \
>   {                                             \
>     asm volatile ("MSR  cpsr, %0 \n"            \
>                   : : "r" (_level));            \
>   }
>
> That means
> cpsr=#3
>
> This not right for ARM. (I think this might be a hidden hazard for BSP.) In fact, the ARM does not have multi-level interrupt.
> If you want to handle IRQ5 for at91, you have to do this in the ExecuteITHandler. in at91rm9200/irq/
Yeah, and the rtems_interrupt_catch() just catch the exception but not
the interrupts
of AIC of at91rm9200, if you want to catch the interrupt just change the address
of vector.
>
>
> ------------------
> Thanks & Best Regards!
> Ray
> 2007-10-25
>
> -------------------------------------------------------------
> From: Rochat_Joël
> Date: 2007-10-24 22:58:50
> To:   rtems-users at rtems.org
> CC:
> Sub:  interrupt on arm9
>
> >>
> >Hello,
> >
> >I'm relative young in rtems developpment. I'm using a board with an ARM9
> >(at91rm9200) cpu on it with csb337 as bsp.
> >
> >The tools I've test such as event, timers, semaphores are working well. I
> >also managed to write some code to 'listen' to
> >an interrupt. I write this code manually :
> >
> >void handlerIRQ (void) __attribute__ ((interrupt ("IRQ"))) ;
> >void handlerIRQ (void)
> >{
> >       doIsr = TRUE ;
> >
> >       //clear irq
> >       AT91C_BASE_AIC->AIC_EOICR = (1 << AT91C_ID_IRQ5) ;
> >       AT91C_BASE_AIC->AIC_ICCR = (1 << AT91C_ID_IRQ5) ;
> >}
> >
> >void initIRQ ()
> >{
> >       //Level sensitivity and priority of interrupt
> >       AT91C_BASE_AIC->AIC_SMR[AT91C_ID_IRQ5] =
> >AT91C_AIC_SRCTYPE_EXT_POSITIVE_EDGE | 1 ;
> >
> >       //give fonction to call when interrupt comes
> >       AT91C_BASE_AIC->AIC_SVR[AT91C_ID_IRQ5] = (unsigned long)handlerIRQ ;
> >
> >       //enable irq
> >       AT91C_BASE_AIC->AIC_IECR = (1 << AT91C_ID_IRQ5) ;
> >}
> >
> >This code works fine. But I try now to use rtems interrupt tools. But I'm a
> >littel bit lost with it here is the code i used
> >
> >//the isr routine
> >rtems_isr user_isr(rtems_vector_number vector)
> >{
> >       gTick = TRUE ;
> >}
> >
> >//the catch methode
> >status =  rtems_interrupt_catch(user_isr, ARM_EXCEPTION_IRQ, &old_isr_handler) ;
> >
> >//then unabled the irq for level 3
> >rtems_interrupt_enable(3) ;
> >
> >When I launch this code on the board it stops one time in the isr routine.
> >Do I have to reste the interupt or somthing like that ?
> >
> >Did someone use the at91rm9200 with interrupt ?
> >
> >How can I say to RTEMS that I want to listen to IRQ5 for exemple ?
> >
> >Think you have a nice day.
> >
> >Joel R.
> >_______________________________________________
> >rtems-users mailing list
> >rtems-users at rtems.com
> >http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>




More information about the rtems-users mailing list