Quality RTOS & Embedded Software

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


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