Quality RTOS & Embedded Software

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



Posted by samkings on November 24, 2015

In the Zynq port of FreeRTOS (V8.1.2) the value of portLOWESTUSABLEINTERRUPT_PRIORITY is defined as:




As I understand it, the Zynq supports 32 levels of interrupt priority, from 0 (highest) to 31 (lowest). However FreeRTOS defines the lowest usable priority as 30, not 31. Why is this?

The FreeRTOSTickHandler is driven by the CPU Private Timer, which generates a Private Peripheral Interrupt with IRQ #29, and the interrupt controller (GIC) is then configured to assign a priority of portLOWESTUSABLEINTERRUPT_PRIORITY (30) to this interrupt. I don't understand why this has to be priority 30 and not priority 31?

I tried changing the priorty to 31 and, not suprisingly, the FreeRTOS scheduler didn't run.

I've read the Zynq Technical Reference Manual chapters on Interrupts and Timers and I don't see any mention of the interrupt priorty 31 being unusable.

It's just an academic quesion, but I'd like to understand why priority 31 is unusable?

Regards, Sam.


Posted by rtel on November 24, 2015

I can't remember the exact details. The Zynq uses a generic ARM GIC (generic interrupt controller), so the information you need is much more likely to be found in the GIC documentation than the Zynq documentation.

It may be something to do with priority masking. Critical sections uses the ICCPMR (priority mask register) to mask a subset of interrupt, rather than globally disable all interrupts. If you write 0 to the PMR, then all interrupts are masked. If you write 255 to the PMR then you unmask (enable) as many priorities are possible, but 255 will, when you take into account the implemented bits, equate to 31, hence it might be simply that priority 31 can never be enabled.......this might be wrong though so take a look at the documentation.



Posted by samkings on November 24, 2015

Ah ha, thanks for the info. I had a quick read of the GIC Spec, it says "The GIC always masks an interrupt that has the largest supported priority field value. This provides an additional means of preventing an interrupt being signalled to any processor."

They seem to be suggesting it is useful a tool to be able to mask out any individual interrupt, without changing any code, other than the assigned priority. I think I can see the benefit of this.

Cheers, Sam.

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


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