Quality RTOS & Embedded Software

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



Posted by Alessio Tognazzolo on March 31, 2010
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?

RE: uxSchedulerSuspended

Posted by Richard on April 1, 2010
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.


Posted by matita87 on August 3, 2017

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 BaseTypet. 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 */ ++uxSchedulerSuspended; } even if it was initialized with pbFALSE: PRIVILEGEDDATA static volatile UBaseTypet uxSchedulerSuspended = ( UBaseTypet ) 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.


Posted by rtel on August 3, 2017

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.


Posted by matita87 on August 4, 2017

Dear In the module task.c the variable uxSchedulerSuspended is define as: PRIVILEGEDDATA static volatile UBaseTypet 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


Posted by matita87 on August 4, 2017

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


Posted by rtel on August 4, 2017

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.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo, Nuvoton Cortex-M23 demo & STM32H745 dual core (AMP) demo.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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