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] [March 2016 Threads] task not switchingPosted by seek25 on March 16, 2016 Hello,
I have 4 tasks all of the same priority, cortex M4. No task uses freeRTOS functions.
Once task A is executed it never gets pre-empted. It just gets executed over and over starving the other.
FreeRTOS is 7.3.0 and thre is no definition about time slice in the freertosconfig.h file.
How was that supposed to work?
Thanks.
IC
Edit:
From here: http://www.freertos.org/FAQSched.html
How are tasks of equal priority scheduled?
Round robin - Ready state tasks that share a priority "take turns" to run.
task not switchingPosted by edwards3 on March 16, 2016 Sounds like the tick interrupt might not be running. Put a break point on xTaskIncrementTick in Task.c, is it hit?
task not switchingPosted by seek25 on March 16, 2016 Just found this, since it is not defined it should switch between them.
configUSETIMESLICING
By default (if configUSETIMESLICING is not defined, or if configUSETIMESLICING is defined as 1) FreeRTOS uses prioritised preemptive scheduling with time slicing. That means the RTOS scheduler will always run the highest priority task that is in the Ready state, and will switch between tasks of equal priority on every RTOS tick interrupt. If configUSETIMESLICING is set to 0 then the RTOS scheduler will still run the highest priority task that is in the Ready state, but will not switch between tasks of equal priority just because a tick interrupt has occurred.
task not switchingPosted by seek25 on March 16, 2016 There is no xTaskIncrementTick in tasks.c
However this gets called and increments
- Calculate the time to wake - this may overflow but this is
not a problem. */
xTimeToWake = xTickCount + xTicksToDelay;
task not switchingPosted by seek25 on March 16, 2016 uxCurrentNumberOfTasks 6 volatile unsigned long(static storage at address 0x20010efc.
)
6 tasks? I have 4 and adding the idle task will make 5, why 6 evaluated at signed portBASE_TYPE xTaskResumeAll( void )
while( listLIST_IS_EMPTY( ( xList * ) &xPendingReadyList ) == pdFALSE )
{
uxNumberOfItems = 0
the below
pxTCB = ( tskTCB * ) listGETOWNEROFHEADENTRY( ( ( xList * ) &xPendingReadyList ) );
uxListRemove( &( pxTCB->xEventListItem ) );
never reached
task not switchingPosted by rtel on March 17, 2016 Why are you using such an old version? I think in that version the function will be called vTaskIncrementTick() (v prefix instead of x prefix).
The additional task might be the timer service task - that will be the case if you have configUSE_TIMERS set to 1.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|