Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists