Quality RTOS & Embedded Software

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




Loading

IRQ interupt causing PrefetchAbort exception

Posted by bones23 on December 20, 2007
I am working on a str912 arm9. I have been fiddling with the joystick interrupt and have found that it randomly causes the PrefetchAbort exception to throw. Has anybody noticed this problem? I have tried setting a breakpoint right at the end of the IRQ handler and stepping through the program but the exception never occurs when i do this. My code is below.

//code for setting up the interrupt
static void prvSetupInterupts( void ){
WIU_InitTypeDef WIU_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;

SCU_APBPeriphClockConfig(__GPIO7, ENABLE);
/*KEY_INT on eval, unused on ADX*/
SCU_APBPeriphClockConfig(__WIU, ENABLE);
WIU_DeInit();

GPIO_DeInit(GPIO7);
GPIO_StructInit(&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable;
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;
GPIO_Init (GPIO7, &GPIO_InitStructure);

/*V_INIT*/
//GPIO_DeInit(GPIO7);
GPIO_StructInit(&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable;
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;
GPIO_Init (GPIO7, &GPIO_InitStructure);

/* Enable the WIU & Clear the WIU line 28 pending bit */
WIU_Cmd(ENABLE);
WIU_ClearITPendingBit(WIU_Line28);

WIU_InitStructure.WIU_Line = WIU_Line28 ;
WIU_InitStructure.WIU_TriggerEdge = WIU_FallingEdge ;
WIU_Init(&WIU_InitStructure);

/* Select WIU line 28 as VIC1.13 interrupt source */
SCU_WakeUpLineConfig(28);

//VIC_DeInit();
/* Configure the External interrupt group 3 priority */
VIC_Config(EXTIT3_ITLine, VIC_IRQ, 11);
/* Enable the External interrupt group 3 */
VIC_ITCmd(EXTIT3_ITLine, ENABLE);
//VIC_SWITCmd(EXTIT3_ITLine, ENABLE);
}

//irq handler
void EXTIT3_IRQHandler(void)
{
int i;
portDISABLE_INTERRUPTS();
{
WIU_ClearITPendingBit(WIU_Line28);
vParTestToggleLED( 3 );
}
portENABLE_INTERRUPTS();
}

RE: IRQ interupt causing PrefetchAbort exception

Posted by Dave on December 20, 2007
Best not to disable and enable interrupts in the ISR, it should not be needed. Also ensure that vParTestToggleLED() does not enter and exit critical sections, you could test the ISR by just toggling the LED directly without using a function call.

that fixed it

Posted by bones23 on December 20, 2007
Your right, the vParTestToggleLED() was entering a critical section. Thanks for the help.


[ 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