Quality RTOS & Embedded Software

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


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

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.


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


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