FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2016 Threads] Behavior of periodic task with other same or lower priority non-periodic tasksPosted 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 tasksPosted 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 tasksPosted 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 tasksPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|