ARM7 asm wrapper gives prefetch abort exept.

I am running FreeRTOS on a LPC2378 using IAR. When I use a ‘normal’ ISR there is no problem: __irq __nested __arm void EMACHandler (void) { …. } If I use the asm wrapper from the ‘uIP_Demo_IAR_ARM7’ Demo:   RSEG ICODE:CODE   CODE32   EXTERN EMACHandler   PUBLIC vEMACISREntry #include "ISR_Support.h" vEMACISREntry:   portSAVE_CONTEXT            ; Save the context of the current task.   bl    EMACHandler            ; Call the ISR routine.   portRESTORE_CONTEXT            ; Restore the context of the current task –                     ; which may be different to the task that                     ; was interrupted. END and function: __arm void EMACHandler( void ) { … } the MCU gives a prefetch abort exeption! What i wrong?? Can anyone help? Best regards, Peter, Denmark

ARM7 asm wrapper gives prefetch abort exept.

There is a LPC2368 demo now, but it uses CrossWorks instead of Embedded Workbench. What did you use as a basis for your project?  Was it an existing demo project? What size have you set the IRQ and Supervisor mode stacks to?

ARM7 asm wrapper gives prefetch abort exept.

I used ARM7_LPC2129_IAR to get started? It is running fine, but not when i use the asm wrapper! I use the same settings in the linkerfile as the LPC2129 Demo: -D_CSTACK_SIZE=200 -D_SVC_STACK_SIZE=190 -D_IRQ_STACK_SIZE=190 -D_FIQ_STACK_SIZE=0 -D_ABT_STACK_SIZE=0 -D_UND_STACK_SIZE=0 -D_HEAP_SIZE=4 The normal ISR (__irq __nested __arm void EMACHandler (void) ) works fine! /Peter

ARM7 asm wrapper gives prefetch abort exept.

The ASM wrapper is only required if you want to perform a context switch from within the ISR. It might be that the IRQ is overflowing a task stack.  When you use the ASM wrapper the task context is saved onto the task stack, when you use a normal C function the necessary registers will be saved on the IRQ stack, so in the former the task stack use will be greater. Try inspecting the stack associated with the current task when the exception occurs (look at the pxCurrentTCB variable in the debugger to find the location of the stack). Regards.

ARM7 asm wrapper gives prefetch abort exept.

I think I found the problem! I forgot to delete this line from the ISR: __enable_interrupt();    /* handles nested interrupt */ It seems to be working now….  :-) Thanks for the quick responce. /Peter