Quality RTOS & Embedded Software

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




Loading

ISR wrapper required ? - ARM7/LPC2378/GCC

Posted by Andreas Pretzsch on June 26, 2008
Environment:
FreeRTOS 5.0
ARM7 / NXP LPC2378
gcc 4.2.2 ; binutils 2.18

Based on some (maybe historic) comment in the forum and/or mailing list, I use the below construct for all my interrupt handlers.
Can anybody confirm or negate this is still needed or was needed at all ?

Thanks in advance,
A. Pretzsch


static void XXXHandler(void)
{
// real ISR
}

static void XXXIsr(void) __attribute__ ((naked));
static void XXXIsr(void)
{
/* Save the context of the interrupted task. */
portSAVE_CONTEXT();
/* Call the handler. This must be a separate function from the wrapper
to ensure the correct stack frame is set up. */
XXXHandler();
/* Restore the context of whichever task is going to run next. */
portRESTORE_CONTEXT();
}

RE: ISR wrapper required ? - ARM7/LPC2378/GCC

Posted by Dave on June 26, 2008
As you are probably aware this was to work around a GCC bug. I don't know if the latest GCC versions have fixed this or not but I think it is a good idea to keep it there.

RE: ISR wrapper required ? - ARM7/LPC2378/GCC

Posted by Andreas Pretzsch on June 26, 2008
Well, now I am :-)

I've got another remark in my Makefile, probably related:
# Probably needed due a compiler bug up till 4.2.1, see
# http://sourceforge.net/forum/message.php?msg_id=4594229
CFLAGS+=-fomit-frame-pointer

I didn't have a look at the exact cause by now, neither at the current compiler status.

Do you know who discovered the problem, maybe he knows more ?
Might be worth a FAQ on the FreeRTOS site.
I'm not a fan of keeping workarounds forever...


[ 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