Quality RTOS & Embedded Software

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


Loading

Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Hi,

I'm trying to write a program for a MSP430 and in my design it is important that one TimerB interrupt is not allowed to disable because it is very time critical and this interrupt can appear in some 10-20µs.
In the freeRTOS I found that global interrupt disable is used (portDISABLE_INTERRUPTS()).
Is there something to keep in mind to change this that all interrupt except the Timer B interrupt?
This interrupt routine will save all changed registers.
Is freeRTOS still executable when one interrupt can appear all the time?

Thanks

RE: Global interrupt disable/enable

Posted by Richard on February 10, 2006
It is inevitable that an OS will from time to time require interrupts to be disabled. This is to ensure consistency of its (ie the schedulers) and tasks structures. FreeRTOS uses a scheduler locking mechanism to allow interrupts to remain enabled for the majority of time while the scheduler data structures are updated - keeping the time interrupts are disabled to a minimum.

10us seems very fast so you may have problems with interrupts being missed even if they are held pending while interrupts are temporarily disabled. You would need to try this on your particular application to know if this was a problem or not.

Allowing interrupts to be nested would help. If you never context switch from within an interrupt this is easy - if you do context switch from within an interrupt then you have to count the interrupt nesting depth and only perform the switch when it was back to zero.

Regards.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Thanks for that information.
When I looked at a scope I can see that sometimes the Timer B output is not correct meaning the interrupt reloading the compare register has not taken place. Since Timer B interrupt has highest priority (except NMI and reset) it can only happen when the GIE is cleared to long preventing the interrupt to take place.
Since the reloading of just the compare register ist a very small routine, I thought to leave this INT enabled all the time. And changing the the
portDISABLE_INTERRUPTS() macro. But I'm not sure if there is any scenario which makes freeRTOS sheduling corrupt.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Provided the interrupt that reloads the timer does not cause a context switch then leaving it enabled should be ok.

Also check the portENTER_CRITICAL macro implementation which may just call portDISABLE_INTERRUPTS or may have a different implementation depending on the port you are using.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
I will try out and thanks for that really fast answer!!


[ 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