Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

ARM7 asm wrapper gives prefetch abort exept.

Posted by Nobody/Anonymous on April 12, 2007
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.
blEMACHandler; 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

RE: ARM7 asm wrapper gives prefetch abort exept.

Posted by embeddedc on April 12, 2007
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?

RE: ARM7 asm wrapper gives prefetch abort exept.

Posted by Nobody/Anonymous on April 12, 2007
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

RE: ARM7 asm wrapper gives prefetch abort exept.

Posted by Richard on April 12, 2007
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.

RE: ARM7 asm wrapper gives prefetch abort exept.

Posted by Nobody/Anonymous on April 12, 2007
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


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS