# uxSchedulerSuspended

**URL:** <https://forums.freertos.org/t/uxschedulersuspended/4616>\
**Category:** Kernel\
**Created:** [March 31, 2010, 9:43am UTC](https://forums.freertos.org/t/uxschedulersuspended/4616 "2010-03-31T09:43:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 31, 2010, 9:43am UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/1 "2010-03-31T09:43:03Z")

</div>

**[ale82t](https://sourceforge.net/u/ale82t/)** wrote on [Wednesday, March 31, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#8418):

Hi to all,  
I have a problem with multitask in freeRTOS 6.0.4. The problem is after some time all tasks are suspended without any apparent reason. FreeRTOS isn’t in a fault situation,but when i controlled the value of the variable uxSchedulerSuspended in task.c i found a very big value (5a5a5a5a5a6). What is the possible cause? Is it possible a task writes something in the memory region where this variable is placed?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [April 1, 2010, 8:35am UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/2 "2010-04-01T08:35:41Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, April 01, 2010](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#34fb):

That definitely looks like a memory corruption, I suspect the number you see starts a5, rather than 5a, as this is the value that task stacks are filled with before the task starts.

You don’t give enough information to offer an opinion on what the possible cause could be.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 3, 2017, 3:56pm UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/3 "2017-08-03T15:56:45Z")

</div>

**[matita87](https://sourceforge.net/u/matita87/)** wrote on [Thursday, August 03, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#0ef2):

Hi to all  
I have a similar problem related to uxSchedulerSuspended.  
In my proj this variable start with FFFFFFFF in routine:  
void vTaskSuspendAll( void )  
{  
/\* A critical section is not required as the variable is of type  
BaseType\_t. Please read Richard Barry’s reply in the following link to a  
post in the FreeRTOS support forum before reporting this as a bug! -  
[http://goo.gl/wu4acr](http://goo.gl/wu4acr) \*/  
++uxSchedulerSuspended;  
}  
even if it was initialized with pbFALSE:  
PRIVILEGED\_DATA static volatile UBaseType\_t uxSchedulerSuspended = ( UBaseType\_t ) pdFALSE;  
The MDK is Keil, FreeRTOS 9.0.0 and board STM32F4.  
The optimization is set to 0.  
NOTE: I have another trivial project (with a different configuration) where vTaskSuspendAll works fine.  
Regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 3, 2017, 4:25pm UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/4 "2017-08-03T16:25:17Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, August 03, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#0ef2/659c):

I don’t understand your question. Can it be rephrased to the following  
statement:

“uxSchedulerSuspended has an initial value of 0xffffffff even though the  
C code initialised it to 0”.

If so that sounds like a compiler or linker or linker script problem,  
not a FreeRTOS problem.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 4, 2017, 8:21am UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/5 "2017-08-04T08:21:45Z")

</div>

**[matita87](https://sourceforge.net/u/matita87/)** wrote on [Friday, August 04, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#5790):

Dear  
In the module task.c the variable uxSchedulerSuspended is define as:  
PRIVILEGED\_DATA static volatile UBaseType\_t uxSchedulerSuspended= ( UBaseType\_t )pdFALSE;  
This variable can be incremented only by vTaskSuspendAll() which is call the first time in xTaskCreate.  
The first time the vTaskSuspendAll() is called the uxSchedulerSuspended is equal to FFFFFFFE (and then incremented by 1)  
This problem appears only with this variable and it causes a problem in vTaskDelay() (e.i. the vTaskDelay() never return because the xTaskResumeAll fails).  
Thanks  
Regards

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 4, 2017, 1:02pm UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/6 "2017-08-04T13:02:29Z")

</div>

**[matita87](https://sourceforge.net/u/matita87/)** wrote on [Friday, August 04, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#d69e):

This problem related to the uxSchedulerSuspended was solved.  
vTaskDelay still dosen’t work, it never return.  
I can see that:  
vTaskDelay(100ms)  
{  
vTaskSuspendAll(); //seems ok  
prvAddCurrentTaskToDelayedList()  
{  
uxListRemove// return 0  
//INCLUDE\_vTaskSuspend == 1  
// here note xTimeToWake \> xNextTaskUnblockTime. is this strange ?  
}  
xTaskResumeAll()  
{  
//xPendingReadyList is not empty.  
//xYieldPending = pdTRUE;  
//pxTCB != NULL  
//uxPendedTicks == 0  
//Here the problem. It not possible to continue debue another tash execute this routine.  
}  
}

How can i solve ?  
thaks all regads

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [August 4, 2017, 2:25pm UTC](https://forums.freertos.org/t/uxschedulersuspended/4616/7 "2017-08-04T14:25:48Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, August 04, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/cb6707b4/#d69e/7f63):

> This problem related to the uxSchedulerSuspended was solved.  
> vTaskDelay still dosen’t work, it never return.

For the benefit of others using this forum, and to ensure this resource  
is as useful for others as possible, please state how the problem was  
solved, after which we can look at your new problem.
