Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner