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

Interrupt Priority Handling with FreeRTOS

Posted by Ivan on March 22, 2011
Hi,

I have been doing code walks through the FreeRTOS on a Renesas RX62N Starters Kit. Everything works great and I am currently up to the point where I am trying to understanding Interrupt Handlers with respect to the RTOS. I am new to RTOS in general and I would like to clarify on the following matter:

When an Interrupt arrives for the MCU, the hardware mechanism will accept the interrupt if the priority set for the interrupt is higher than that of the current interrupt priority level set in the Interrupt Priority Register. That being said, I am wondering how does the mechanism to inform the kernel that an interrupt has arrived works in FreeRTOS?

Is there something like a "portYIELD_FromISR()" kind of mechanism?

Many thanks in advance. Cheers :)

RE: Interrupt Priority Handling with FreeRTOS

Posted by Richard on March 23, 2011
“That being said, I am wondering how does the mechanism to inform the kernel that an interrupt has arrived works in FreeRTOS? ”


The kernel does not effect how interrupts are processed in the RX port. The MCU just accepts the interrupt as per normal, processes it (maybe nests with other interrupts), then returns to the task level when all interrupt processing is complete.

If no yield is required in the interrupt then the interrupt will return to whichever task was running prior to the interrupt being entered.

If a yield is required in the interrupt then portYIELD_FROM_ISR() just sets a software interrupt into the pending state, then when the interrupt completes the software interrupt will execute. The software interrupt may change the task that is in the Running state, and therefore return to a task that is not the same as the task that was originally interrupted - therefore a context switch has been performed.

The software interrupt is the lowest priority interrupt, so will never mask other interrupts, as is guaranteed to complete last if it gets interrupted by any higher priority interrupts.

Regards.

RE: Interrupt Priority Handling with FreeRTOS

Posted by Ivan on March 24, 2011
Ah ... I see, that makes it so much clearer now. Thanks loads :)

Big fan of your work! Cheers!


[ 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