Quality RTOS & Embedded Software

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


Certain tasks stop running

Posted by mishung on March 30, 2017

Hello! I have a problem that after a random ammount of time (10minutes - 12hours) certain tasks stop executing. I believe this is caused by some kind of data corruption caused by me but I can't seem to find when and what gets corrupted. Can you suggest any dubugging utility that could help me find out what happens? Or where to set data breakpoint?

What I know so far: Total ammount of SRAM available: 16kB Total ammount of SRAM used: 10,9kB Heap size: 6kB (only 3,8kB actually used) Number of tasks: 12 Number of priorities: 4 No stack overflow detected anywhere, every task has at least 50 words high water mark

I called the vTaskList after 2 of the tasks stopped working and one of these two was in Blocked state and the other one was in Ready state. Both of them had about 100words of stack still unused. One of them had a priority of 4 which no other task has and it is the simplest task of them all so there is no way it could get stuck in a loop (actually there is no loop in that task).

Here is the code to the priority 4 task that stopped executing: ~~~ void pwrTask(void* p) { for ever { if(powerisdropout()) go_sleep();


	// monitor for maximal stack depth
	pwrTask_high_water_mark = uxTaskGetStackHighWaterMark(NULL);

} ~~~

I am using a port of FreeRTOS on AVR atmel xmega256a3u (8 bit).

Any suggestion would be greatly appreciated!

Certain tasks stop running

Posted by rtel on March 30, 2017

There are a few debug aware plug-ins and the trace tool available, but that's a pretty small and basic device, so I don't think they are going to work for you.

What does the go_sleep() function do?

Certain tasks stop running

Posted by mishung on March 30, 2017

Yes indeed, the trace tool does not work in this case, unfortunately. The go_sleep() does something in this manner:

~~~ disableperipheralx(); disableperipheraly();

while(!powerisstable) sleep_cpu();

enableperipheralx(); enableperipheraly(); ~~~

but if the power was out and go_sleep() was called, nothing would work because it stops everything except the RTC. And this function has been tested numerous times, if I turn the power off, the MCU goes to sleep mode and after the power is back on it wakes up no problem.

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

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 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