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


portENTER_CRITICAL() with-in and ISR in AVR32

Posted by Alexis on March 25, 2013
I have read in multiple area that FreeRTOS calls with "FromISR" should be called with-in an ISR. I have also seen threads where users are specifically told not to use "portENTER_CRITICAL" with-in and ISR, these threads always refer to the ARM Cortex port.

I have been surrounding all my calls with-in ISR as follows:

xSemaphoreGiveFromISR( m_TransmitMobSemaphore, &xHigherPriorityTaskWoken );

Now i am having an intermitted problem and trying to track it down. Not sure if Stack, or interrupts at the moment. But re-reading the manual and the forums i have found that i may well have made a mistake by using "portENTER_CRITICAL();" with-in interrupts.

Now the question is:
vTick() in port.c which is provided with the AVR32 port FreeRTOS V7.0.0 does the following

/* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
calls in a critical section . */

Is that a mistake? is this a special case? Should i leave all my portENTER_CRITICAL(); in my ISR's?


RE: portENTER_CRITICAL() with-in and ISR in AVR32

Posted by Dave on March 25, 2013
Documentation pages for demos always have an "Interrupt Service Routines" section, and the section on the AVR32 page http://www.freertos.org/portAVR32.html says to place the calls in critical sections.

This is an old and I think obsolete port for old AVR32 chips that behave a bit differently to the new ones. The maintained AVR32 code is in the Atmel Software Framework (found at Atmel.com).

RE: portENTER_CRITICAL() with-in and ISR in AVR32

Posted by Alexis on March 25, 2013
Thanks for the quick reply.
Looking at the linked page it does seem to have some slight differences to what is available in the my port, any idea what release that page refers to?

I will keep the critical sections in the code as advised by the link.

Looking at Atmel, they have both 7.0.0 (currently being used) and 7.3.0 in the latest ASF release.I would be weary of moving to 7.3.0 as it would require more validation, will look for a release history so i can see what was fixed.

RE: portENTER_CRITICAL() with-in and ISR in AVR32

Posted by Richard on March 25, 2013
The changes to the FreeRTOS core files can be found here: http://www.FreeRTOS.org/History.txt. You would have to look at any history information provided by Atmel to see any changes made to the port layer they maintain.


[ 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