MQX - Task Stack Size

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MQX - Task Stack Size

ソリューションへジャンプ
4,555件の閲覧回数
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,453件の閲覧回数
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,453件の閲覧回数
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,453件の閲覧回数
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,453件の閲覧回数
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,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 件の賞賛
返信
1,453件の閲覧回数
javax
Contributor I

Thanks PetrL.

 

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

 

Thanks again

 

 

0 件の賞賛
返信