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


Hangs on PIC32 uxPortSetInterruptMaskFromISR

Posted by Coco on July 22, 2013
Hi, I just started using FreeRTOS ( PIC32 ) and got an issue once I call xSemaphoreGiveFromISR. I call this API from an interrupt that is set to priority 1. I narrow down the hang to the uxPortSetInterruptMaskFromISR, when it tries to _CP0_SET_STATUS. Couple of questions :
1. uxSavedStatusRegister = _CP0_GET_STATUS() | 0x01;
Is this call really needed? when the interrupt happens, the IE bit should already set unless it is disable by the "asm volatile ("di")" ? Any idea what might cause the hang? What puzzling is the Timer tick interrupt is also running with priority 1 and it has no issue.

2. portALL_IPL_BITS is set to 0x3fUL. From what I read in PIC32 spec, the IPL bits are bit 10-12 (3bits), shouldn't this value be 0x7UL ?


RE: Hangs on PIC32 uxPortSetInterruptMaskFromISR

Posted by Coco on July 22, 2013
Some update on issue 1, I found out the hang is caused by the interrupt bit is not yet cleared when I call that function. So as long as I clear the interrupt bit before calling the uxPortSetInterruptMaskFromISR , everything works fine.

RE: Hangs on PIC32 uxPortSetInterruptMaskFromISR

Posted by Richard on July 22, 2013
Are you following the instructions in the "Interrupt Service Routines" section of the following page: http://www.freertos.org/port_PIC32_MIPS_MK4.html ? You should never find interrupts are disabled inside the interrupt handler unless you disabled them.


[ 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