Quality RTOS & Embedded Software

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




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists