portENTER_CRITICAL() with-in and ISR in AVR32

alexisj204 wrote on Monday, 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?


davedoors wrote on Monday, 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).

alexisj204 wrote on Monday, 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.

rtel wrote on Monday, 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.