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

int for avr32 using xHigherPriorityTaskWoken

Posted by IvanSB on October 21, 2010
I'm following the example in the "Using FreeRTOS Real Time Kernel" (version 1.3.2).
I couldn't find any use of portSWITCH_CONTEXT() and portYIELD_FROM_ISR() in the port distributed with Atmel software framework neither they are used in any example contained in FreeRTOS 6.1.0.

How am I supposed to write an interrupt routine that actually return to the higher priority task?

thanks


RE: int for avr32 using xHigherPriorityTaskWoken

Posted by Dave on October 22, 2010
I think the text states that different ports do this in different ways. Each port documentation page has a section called 'interrupt service routines' which explains how to do it for that port. The AVR32 page is here http://www.freertos.org/portAVR32.html

RE: int for avr32 using xHigherPriorityTaskWoken

Posted by IvanSB on October 22, 2010
Thanks.

I've already read that page but apparently I'm missing the meaning or its not giving an example of what I was looking for.
From what I've understood from the book if I'm


xSemaphoreGiveFromISR(xBinarySemaphore, &xHigherPriorityTaskWoken);


I could then conditionally return to the higher priority task calling


if( xHigherPriorityTaskWoken == pdTRUE) {
portSWITCH_CONTEXT();
}

Skipping a redundant return to the OS.

I'm not really sure if this correspond in functionality to the example you pointed at.
Furthermore I've a couple of doubt:
It is said that "calls made to API functions from within an ISR must be contained within a critical section refers to just interrupt with same priority of the OS"
But then I've not completely clear:
configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY at:
http://www.freertos.org/index.html?http://www.freertos.org/a00110.html

So summing up I have:
1) interrupt with higher priority than the OS that:
a) can't make context switch and use the "xHigherPriorityTaskWoken" functionality
b) can't make calls to the OS API
2) interrupt that have same priority than the OS
a) and don't use API
b) and use the API but don't require context switch
c) and use the API and require a context switch
3) interrupts that have a lower priority than the OS
a) b) c)...

1) can't make a context switch I could write them without prologue/epilogue (portENTER_SWITCHING_ISR/portEXIT_SWITCHING_ISR) and set the attribute to interrupt inspite of naked

2c) and 3c) seems requires prologue and epilogue and can be declared naked.

What about 2ab) and 3ab)?

What does it happen if I skip the prologue/epilogue in 2) and 3)?
Interpreting from the example in the book that would give control back to the OS that in turn will give control to the higher priority task... requiring one more context switch rather than just returning to the higher priority task directly.
Is it?
Would it be reasonable if I expect the interrupt to rarely interrupt higher priority tasks to skip the prologue/epilogue?

Did I get it right? Partially right? Wrong?


[ 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