Quality RTOS & Embedded Software

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




Loading

StackOverflow while Debugging one task

Posted by Patrick_ECR on December 16, 2011
Hi

I'm debugging a new project which runs with FreeRTOS and have got an problem during debugging the source.

Problem:
Everytime I set a breakpoint in one task, there are three taks running (quasi-)parallel, it stops there and next time never gets to this BP again. When I stop the application I see, that the vApplicationStackOverflowHook()-function was called. The other 2 tasks are still running fine. But the task I want to debug, is now in the endless-for-loop..

I can also do the same with one of the two other running tasks, which also stops then after reaching the overflow-function..

Any suggestions?

Best regards
Patrick

RE: StackOverflow while Debugging one task

Posted by Dave on December 16, 2011
“Any suggestions?”


Yes - tell us which chip and compiler you are using.

RE: StackOverflow while Debugging one task

Posted by Patrick_ECR on December 19, 2011
Omg ... bad job from my side to forget it.

I use MCF52259 (on MCF52259EVB) from Freescale. IDE CW 10.1, I use the included Coldfire-Compiler there.

The code I use is the following:


#define Queue_Active 0

unsigned int counter;
unsigned int counter_T2;
xQueueHandle xQueue1;


static portTASK_FUNCTION(vMainTask, pvParameters) {
const portTickType xDelay = 2/portTICK_RATE_MS;
portTickType xActual = 0;

#if Queue_Active
counter = 0;
xQueue1 = xQueueCreate(4, sizeof(unsigned int));

if(xQueueSend(xQueue1,&counter,10) != pdPASS ){
portNOP();
}
#endif

for(;;){
xActual = xTaskGetTickCount();
vTaskDelayUntil(&xActual,xDelay);
#if Queue_Active
portENTER_CRITICAL();
#endif
Bit1_NegVal();
#if Queue_Active
xQueueReceive(xQueue1,&counter,1);
counter++;
xQueueSend(xQueue1,&counter,1);
counter = 0;
portEXIT_CRITICAL();
#endif
}
}


static portTASK_FUNCTION(vMainTask2, pvParameters) {
const portTickType xDelay = 2/portTICK_RATE_MS;

for(;;){
vTaskDelay(xDelay);
#if Queue_Active
portENTER_CRITICAL();
#endif
Bit2_NegVal();
#if Queue_Active
xQueueReceive(xQueue1,&counter_T2,1);
counter_T2++;
xQueueSend(xQueue1,&counter_T2,1);
counter_T2 = 0;
portEXIT_CRITICAL();
#endif
}
}


static portTASK_FUNCTION(vMainTask3, pvParameters) {
const portTickType xDelay = 10/portTICK_RATE_MS;

for(;;){
vTaskDelay(xDelay);
Bit3_NegVal();
}
}


I already tried to increase stack ov all and of certain tasks (from standard 600 to 2.4k) but without success.

Thx!

Best regards
Patrick


[ 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