Quality RTOS & Embedded Software

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




Loading

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:


portENTER_CRITICAL();
xSemaphoreGiveFromISR( m_TransmitMobSemaphore, &xHigherPriorityTaskWoken );
portEXIT_CRITICAL();


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 . */
portENTER_CRITICAL();
vTaskIncrementTick();
portEXIT_CRITICAL();


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

Regards,
Alexis

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.

Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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