FreeRTOS always show stack over usage

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FreeRTOS always show stack over usage

1,239 次查看
kensu
Contributor V

Hi,

I am debugging with my application with FreeRTOS on LPC1830,

At first, I find my application have different running result with enable debug message out and disable.

When I enable my debug message, the result is correct.

In my experience, my application may has something wrong.

I find one of my task always show the stack usage is too much,

I don't know why, no mater how I increase the stack size, and I remove all variable and function call in this task,

pastedImage_1.png

It still happens?

Is any possible reason to cause this condition?

Thanks

Ken

标签 (1)
标记 (3)
0 项奖励
回复
6 回复数

1,020 次查看
BlackNight
NXP Employee
NXP Employee

Hi Ken,

can you share the code how you crate the MainControl task? Of interest is how much of stack you actually are requesting for the task.

Otherwise it could be that a dangling pointer changes/corrupts your TCB (Task Control Block), causing the task list to report a wrong stack size?

I assume you have enabled the stack overflow hook and the FreeRTOS asserts too?

I hope this helps,

Erich

0 项奖励
回复

1,020 次查看
kensu
Contributor V

Hi

Thanks for fast reply,

After I remove any variable and API, actually, the task is almost empty.

But it also happen the stack size usage is over. So I think the cause is not the task itself.

pastedImage_1.png

I am not sure where to enabled stack overflow hook and FreeRTOS asserts.

I will confirm it soon.

B.R.

Ken

0 项奖励
回复

1,020 次查看
BlackNight
NXP Employee
NXP Employee

Hi Ken,

I was interested in how you create that task with xTaskCreate().

And why are you not using

vTaskDelay(pdMS_TO_TICKS(1000));

in your task instead of that utilTaskSleepMilliSec()?

I hope this helps,

Erich

0 项奖励
回复

1,020 次查看
kensu
Contributor V

Hi Erich,

 I create the task with the API,

xTaskCreate(taskSystemMainControl, "MainControl", TASK_SYSTEM_MAIN_CONTROL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 1UL), (TaskHandle_t *) NULL);

And My utilTaskSleepMilliSec() is called vTaskDelay API,

I verify the application on LPC1857 evaluation broad , I also check again the stack usage in LPC1857, it's no problem.

But when I transfer the code to LPC1830, these problem happens.

Hard to know why.

Thanks

Ken

0 项奖励
回复

1,020 次查看
BlackNight
NXP Employee
NXP Employee

Hi Ken,

what is the content of TASK_SYSTEM_MAIN_CONTROL_STACK_SIZE ?

Erich

0 项奖励
回复

1,020 次查看
kensu
Contributor V

Hi,

I don't enable hook function.

Ken

0 项奖励
回复