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
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).