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

Behavior of periodic task with other same or lower priority non-periodic tasks

Posted by adiman1984 on January 22, 2016

I encountered an issue where a periodic task (using vTaskDelay) doesn't run when other non periodic tasks are very active. This makes sense for non-periodic tasks with the same or higher priority than the periodic tasks, but I found that a busy lower priority task (task blocks/reads from queue) also causes a "lockout" of the periodic task. In this case, I would assume that once the timer for the periodic task expires, the scheduler will always switch to the higher priority periodic task at least by the next sys tick (depending whether pre-emption is enabled, which it is). Generally speaking, this should be correct, right? What could cause a periodic task to be "locked out" when lower priority non-periodic tasks are busy and can run continuously?


Behavior of periodic task with other same or lower priority non-periodic tasks

Posted by edwards3 on January 22, 2016

is the low priority task keeping interrupts disabled for long periods?


Behavior of periodic task with other same or lower priority non-periodic tasks

Posted by adiman1984 on January 22, 2016

No, but there is a UART ISR that puts data into a queue. The low-priority task reads/blocks on this queue. The issue I'm seeing occurs when there's a lot of communication going on. Neither the ISR nor the low-priority task disables interrupts purposefully (except inside the freeRTOS APIs that are called)


Behavior of periodic task with other same or lower priority non-periodic tasks

Posted by rtel on January 22, 2016

How are you using the queue in the interrupt? Lots of our demos place every received character into a queue - which is fine for testing the kernel (which is why we do it) and convenient for low bandwidth interfaces such as telnet key handling, but otherwise very inefficient. Ideally use a DMA, or at least a FIFO, and place received characters in a RAM circular buffer. Then, when a message is complete, or a break in communication is detected, use a direct to task notification to unblock a task. That will be much more efficient.


[ 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