Quality RTOS & Embedded Software

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




Loading

Interrupt Wrappers, etc.

Posted by sfalias on March 17, 2015

Hi,

In this post about counting sempahores:

https://sourceforge.net/p/freertos/discussion/382005/thread/5e30e7e0/

there was a link to implementing interrupts. I'm using a PIC32MX and I believe I have a conflict between my UART and USB interrupts. When I don't use USB, my UART receive interrupt works fine. With USB data going back and forth, somehow I get an occasional byte in my UART ISR which is corrupted.

I'm really confused about the max priority level in FreeRTS configuration and how I should configure the priorities of my ISRs.

My UART interrupt is defined as follows, I believe in agreement with the FreeRTOS requirements:

void attribute( (interrupt(IPL3SOFT), nomips16, vector(UART2VECTOR))) U2InterruptWrapper(void);

But my USB ISR is defined by the Microchip USB implementation as follows:

void attribute((interrupt(), vector(USB1_VECTOR))) _USB1Interrupt( void );

If I make USB priority 2, I get a general exception. If I make it 4, I still have the data corruption.

BTW, the corruption is weird. At random times, my receive data buffer has a byte replaced by the byte received 3 bytes prior to the current byte. It's as if the buffer index is modified, and always by a 3 byte offset.

Any suggestions?

Thanks,

Dave


Interrupt Wrappers, etc.

Posted by rtel on March 17, 2015

Are both interrupts using the FreeRTOS API, or just the UART interrupt?

Regards.


Interrupt Wrappers, etc.

Posted by sfalias on March 17, 2015

The USB interrupt does not use the FreeRTOS wrapper. I might try adding that in now.

Thanks,

Dave


[ 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