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

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) 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