Quality RTOS & Embedded Software

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




Loading

Scheduler Stoppage, Task Run Counters

Posted by John W. on May 9, 2006
Richard,

I'm doing some debugging and I've put a while (1){};
after where the scheduler starts - my code should never reach it because I don't stop the scheduler - but I'm seeing it reach that point on some of my targets. Is the most likely problem a stack issue?

I've noticed as well in virtually all of your examples you keep task run counters - and then you check the counters periodically for errors. I suppose you recommend doing this with all tasks - correct? I know a task will stop if there are stack issues; - the processor I'm working with will croak usually if anything wrong happens with the stack - I was just wondering if you always recommend keeping track of the task run counters - I do it in my debugger - but I don't usually have a function that does a compare like in your examples.

Thanks,
John

RE: Scheduler Stoppage, Task Run Counters

Posted by Richard on May 9, 2006
Slightly hurried response ...

In theory you should only reach the while(1) if there is not enough RAM left in the heap for the idle task to be created. The idle task is created when the scheduler is started and the scheduler will not start if it cannot be created.

The counter of the number of tasks is only included as a check for correct operation when the "suicide" tasks are inlucded in the demo. These tasks created and kill themselves over and over so the counter encusres correct operation by ensuring the number of tasks in the system is not growing (indicating that they are not deleting properly).

Regards.

RE: Scheduler Stoppage, Task Run Counters

Posted by John W. on May 9, 2006
Richard,

My app. runs awhile before I see this. Could the IDLE task run out of stack on a yield? Would
it exit 'gracefully' or would you just see the stack be corrupt - I would think the latter.

Thanks,
John

RE: Scheduler Stoppage, Task Run Counters

Posted by Nobody/Anonymous on May 9, 2006
It would not know and therefore behave unpredictably. Sounds like a crash of some sort.

RE: Scheduler Stoppage, Task Run Counters

Posted by John W. on May 15, 2006
Yes, it is a crash of some sort.
John


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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