Quality RTOS & Embedded Software

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


Loading

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();

	vTaskDelay(1);

	// 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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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