Quality RTOS & Embedded Software

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


Loading

PIC32 Interrupt Hanging

Posted by Boseji on January 5, 2009
Hello,

I am using FreeRTOS for my project.
The primary tasks for the Scheduler have LED blinking code.
I am trying to configure an Interrupt for INT1 signal.
But when ever the interrupt occurs the chip enters _general__general_exception_handler().

Following are my Hardware & Software Details:
PIC32MX360F512L
SYSCLK = 40MHz
PBCLK = 40MHz
MPLAB 8.15a
MPLAB C32 v1.04
FreeRTOS v5.1.0

MyCode:
http://sites.google.com/site/pic32site/Home/24_FreeRTOStest5code.zip
Kindly help me out with this.

Warm Regards,
Boseji

My PIC32 Project:
http://www.mypic32.com/web/guest/contestantsprofiles?profileID=32956

RE: PIC32 Interrupt Hanging

Posted by Dave on January 5, 2009
The way the interrupt is written looks just like the serial port example from the demo, except the line

void __ISR(_INT1_VECTOR,ipl2) vINT1Handler();

in your code, and the equivalent

void __attribute__( (interrupt(ipl1), vector(_UART2_VECTOR))) vU2InterruptWrapper( void );

for the serial port example. Is the __ISR equivalent to the __attribute__?



RE: PIC32 Interrupt Hanging

Posted by Boseji on January 5, 2009
Hello,

I have tested the code with the following code:
void __attribute__( (interrupt(ipl2), vector(_INT1_VECTOR))) vINT1Handler();

This is the same as that of the __ISR when I referred to the C32 documentation.

I am suspicious of the code in prvSetupHardware():

/* Setup to use the external interrupt controller. */
INTEnableSystemMultiVectoredInt();

portDISABLE_INTERRUPTS();//I am not very sure what this is about

This function is called in the beginning of the Main function and never called again. But the _general_exception still occurs.

Kindly help me out understanding this.

Thanks,

Warm Regards,
Boseji

My PIC32 Project:
http://www.mypic32.com/web/guest/contestantsprofiles?profileID=32956

RE: PIC32 Interrupt Hanging

Posted by Richard on January 5, 2009
INTEnableSystemMultiVectoredInt() sets the microcontroller to use multi vectored mode rather than routing all interrupts through a single vector entry. The PIC32 has to option to use both methods.

portDISABLE_INTERRUPTS() is called to prevent interrupts from occurring before the scheduler has been started. This is because any interrupt that executes and attempts a context switch (or maybe even calls an API function) before the scheduler has started could cause the system to crash. Interrupts are automatically re-enabled as the context of the first task to run is restored.

Regards.

RE: PIC32 Interrupt Hanging

Posted by Boseji on January 5, 2009
Hello,

I have tried lots of tricks but the program still enters the "_general_exception_handler". Although going through the FreeRTOS demo I realized the fact that there is some separate context switch required for the Interrupt but even that did not help. Another thing that I observed when I was in the "_general_exception_handler" the Interrupt Flag for the INT1 interrupt shows in the INTSTAT register along with the priority of the vector. This means that some where the OS is crashing and and giving rise to some un-handled exception.
If there is simpler example for the interrupt handling under FreeRTOS port for PIC32 please let me know.

Kindly help me out with this.

Warm Regards,
Boseji

My PIC32 Project:
http://www.mypic32.com/web/guest/contestantsprofiles?profileID=32956

RE: PIC32 Interrupt Hanging

Posted by Boseji on January 6, 2009
Hello,

After a lot of tries I was able to get some help from the Microchip forum.
There was a mistake in the Interrupt vector name:

void __ISR(_INT1_VECTOR,ipl2) vINT1Handler(); //Wrong

Corrected Line:
void __ISR(_EXTERNAL_1_VECTOR,ipl2) vINT1Handler(); //Alright

However the compiler didn't complain so I was unable to gauge that.

Thanks for your Support.

Warm Regards,
Boseji

My PIC32 Project:
http://www.mypic32.com/web/guest/contestantsprofiles?profileID=32956


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner