MQX - Task Stack Size

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

MQX - Task Stack Size

跳至解决方案
4,556 次查看
Vijayaragavan
Contributor I

Hi Guyz,

 

       I am new to MQX RTOS and i am working on MQX 3.0(MCF52259 DemoKit).

how exactly can i set stack size when creating the task?.

can any one explain me regarding that?.

is there any way to find out with trial and error method?

if yes how?

 

Thanks

Vijayaragavan S

 

0 项奖励
回复
1 解答
1,454 次查看
PetrL
NXP Employee
NXP Employee

Hi,

 

ensure that MQX_KERNEL_LOGGING is set to one in your user_config.h file and that "c:\Program Files\Freescale\Freescale MQX 3.6\mqx\source\klog\kl_stack.c" is compiled in you psp library.

 

Also is always better to use the latest MQX version (currently 3.6.2) . I think that stack usage check function was not included in the MQX 3.0.0.

 

Regards,

PetrL

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,454 次查看
JuroV
NXP Employee
NXP Employee

You have 3 possibilities:

1) guess and exagurate to be sure that the size will never be overrun

2) analytically check the size of subsequent calls and their stack size; however- for large numbers of nested calls and their variations this is not trivial

3) do 1) and consequently use MQX TAD and look for stack usage, where the used column can tell you the max. watermark level of the stack.

0 项奖励
回复
1,454 次查看
Nouchi
Senior Contributor II

Hello,

 

You're right but TAD needs CW professional edition :smileysad:

I use kernel logging features, enable by  MQX_KERNEL_LOGGING and MQX_MONITOR_STACK (needs to compile MQX libraries),  then use _klog_show_stack_usage() in your application to output messages on stdout device, it gives an idea about stack memory consumption.

 

Emmanuel

0 项奖励
回复
1,454 次查看
javax
Contributor I

Hi every body

 

I am trying to catch a bug through ebabling MQX_KERNEL_LOGGING and MQX_MONITOR_STACK and use _klog_show_stack_usage() but I´'ve got this error message:

 

Link Error   : Undefined : "_klog_get_task_stack_usage"
Referenced from "spi2_task_Entry" in

Link Error   : Undefined : "_klog_show_stack_usage"
Referenced from "spi2_task_Entry" in

Link failed.

I appreciate any help

0 项奖励
回复
1,455 次查看
PetrL
NXP Employee
NXP Employee

Hi,

 

ensure that MQX_KERNEL_LOGGING is set to one in your user_config.h file and that "c:\Program Files\Freescale\Freescale MQX 3.6\mqx\source\klog\kl_stack.c" is compiled in you psp library.

 

Also is always better to use the latest MQX version (currently 3.6.2) . I think that stack usage check function was not included in the MQX 3.0.0.

 

Regards,

PetrL

0 项奖励
回复
1,454 次查看
javax
Contributor I

Thanks PetrL.

 

I carried out a whole MQX library recompilation and now klog functions are working.

 

Thanks again

 

 

0 项奖励
回复