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

FreeRTOS support multi-level of interrupt?

Posted by newnie super on June 17, 2009
I'm porting FreeRTOS to my application. It seems that FreeRTOS protects the critical section simply by disabling the global interrupt and reenabling the global interrupt when exit from critical section. The problem is, my application may have disabled the global interupt before calling protection function, such as EnterCritical, which means when exit from the critical section the global interrupt will be enabled but my application doesn't want to.
Any help would be greatly appreciated.
Thanks.

RE: FreeRTOS support multi-level of interrupt?

Posted by Richard Damon on June 17, 2009
The simple solution is for you to use the EnterCritical/ExitCritical functions to disable/enable interrupts in your own code.

You should be a bit careful with this, as some ports of freeRTOS do not disable ALL the interrupts in critical sections, but only those below the level that are allowed to access the kernel, so if you need others disabled you should do it in a way that you can easily fix for when (or if) that feature makes it to the port you are using.

RE: FreeRTOS support multi-level of interrupt?

Posted by newnie super on June 17, 2009
Many thanks for your reply but you might be misunderstanding my question.

To sum up, my code needs to recover the interrupt status after ExitCritical called, i.e., if the interrupt has been disabled before EnterCritical is called, then the interrupt status should still keep disabled even ExitCritical called after.

Thanks again.

RE: FreeRTOS support multi-level of interrupt?

Posted by Richard Damon on June 17, 2009
The way to do that is to use EnterCritical as the way to disable your interrupts. That way FreeRTOS can manage the interrupts.

The other option is to change EnterCritical/ExitCritical to somehow save the interrupt state (or at least what the interrupt state was when the first level of EnterCritical was called), and have this restored by ExitCritical. Note that this will add overhead to all Critical Setions, so the first method (using calls to EnterCritical) is preferred.


[ 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