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

AVR32 UC3 port: vTaskDelay thread- and interrupt-safe?

Posted by threis on April 30, 2014

Hi,

when i look at the function vTaskDelay() i wondered about the missing entering of a critical section at the beginning of the function. The function call of vTaskSuspendAll() just increment the variable uxSchedulerSuspended, which e.g. is polled at context switch. If an timer interrupt occurs during vTaskDelay() is processed, this function would interrupted before the calling task could inserted into the list of delayed tasks. If then the timer interrupt would processed and check if there are tasks ready to run, these tasks would removed from the delayed task list and put in the ready task list. If now the cpu returned to processing of the function where the interrupt occured, this list of delayed tasks would corrupted. I think the call of vTaskDelay() must be thread- and interrupt-safe. What do you thing about? Do you agree with my conclusion or is there anything i didn't consider?

I'm using the AVR32 UC3 port.

Please excuse my english. Thank you


AVR32 UC3 port: vTaskDelay thread- and interrupt-safe?

Posted by rtel on April 30, 2014

FreeRTOS minimises its use of critical sections in order to remain as responsive to interrupts as possible. It uses the scheduler locking as a means of allowing interrupts to remain enabled. When the scheduler is locked the kernel's data structures are protected from interference from the timer (or any other interrupt that is written correctly). Instead such interrupts manipulate a set of 'pending' data structures. Any 'pending' updates are processed into the main kernel data structures when the scheduler is unlocked.

Note the UC3 port in the main FreeRTOS download is no longer supported as it only runs on ES chips (it works around silicon bugs that no longer exist in the chips). Atmel have their own port in the ASF, but we are understandably unable to support third party code directly.

Regards.


[ 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