Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Exception Handling

2006-04-04 by Sten

gtechnzltd wrote:
> Hi there,
> 
> Any advice on exception handling. Do you think this is the best 
> using the GCC tools.
> 
> 1: Define the exception handles and functions in main, EG:
>  //prototype exception handling functions
>  void IRQ_Routine (void)   __attribute__ ((interrupt("IRQ")));
>  void FIQ_Routine (void)   __attribute__ ((interrupt("FIQ")));
>  void SWI_Routine (void)   __attribute__ ((interrupt("SWI")));
>  void UNDEF_Routine (void) __attribute__ ((interrupt("UNDEF")));
> 
>  //exception handling functions
>  void IRQ_Routine (void) {while (1) ;}
>  void FIQ_Routine (void)  {while (1) ;}
>  void SWI_Routine (void)  {while (1) ;}
>  void UNDEF_Routine (void) {while (1) ;}
> 
> 2: In the start up file define the vectors to the functions in main EG:
> Undef_Addr:     .word   UNDEF_Routine /* defined in main.c  */
> SWI_Addr:       .word   SWI_Routine   /* defined in main.c  */
> PAbt_Addr:      .word   UNDEF_Routine /* defined in main.c  */
> DAbt_Addr:      .word   UNDEF_Routine /* defined in main.c  */
> IRQ_Addr:       .word   IRQ_Routine   /* defined in main.c  */
> FIQ_Addr:       .word   FIQ_Routine   /* defined in main.c  */
> 
> Is this all there is to exception handling?
> 
> Comments welcome.
> 
> Regards
> Grant 
> NZ
> 
> 

Hello,

one week ago we had a discussion about correct code generation using gcc in conjunction with
__attribute__((interrupt("IRQ"))). See message #14601.
I explored that if you do not call any other functions from an ISR gcc (4.0.1, 4.1.0) produces
correct entry/exit code. Otherwise you can get a lot of trouble. In this thread there are some
different solutions to avoid it.

  Sten

-- 
/************************************************
 Do you need a tiny and efficient real time
 operating system (RTOS) with a preemtive
 multitasking for LPC2000 or AT91SAM7?

   http://nanortos.net-attack.de/

 Or some open-source tools and code for LPC2000?

   http://www.net-attack.de/

************************************************/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.