RTCS TCP/IP Task stack size reduction

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTCS TCP/IP Task stack size reduction

Jump to solution
1,870 Views
CarlFST60L
Senior Contributor II

Hi Guys,

I am using RTCS which creates a TCP/IP task with 3K of RAM but for my DHCP / TCP / UDP software I have only seen it use well under 1Kb of RAM.

Is it safe to reduce this a little to say 1.5K of RAM? What situations will the TCP/IP task use more RAM?

Here is my task stack usage:

Interrupt stack:    size 00001024    used 00000416

SIZE                  USED                 TASK ID      NAME

00000896(00000380)    00000692(000002B4)   00010001     MAIN_TASK

00000512(00000200)    00000392(00000188)   00010002     X_Task

00000768(00000300)    00000416(000001A0)   00010003     XX_Task

00002304(00000900)    00002144(00000860)   00010004     XXX_Task

00001280(00000500)    00000556(0000022C)   00010005     XXXX_Task

00003328(00000D00)    00002956(00000B8C)   00010006     ETH0_Task

00003000(00000BB8)    00000740(000002E4)   00010007     TCP/IP

0 Kudos
Reply
1 Solution
1,279 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Not certain if this solves the issue but...

Hands-on Workshop: Tower System Solutions, Part 3: Optimizing and Configuring an MQX™ RTOS, Intermed...FTF-ENT-F0081Enabling TechnologiesOperating SystemsHands-on Workshop

PDF

The above is from our www.freescale.com/ftf link, click on America's and then Technical Sessions Library.

The general rule of thumb for task stack space is start big and reduce "carefully".

If you have a IDE with TAD (task aware debugging), after running the application through its paces, you can look at the stack space used to get idea of how to adjust.

Regards,

David

View solution in original post

0 Kudos
Reply
2 Replies
1,279 Views
CarlFST60L
Senior Contributor II

Ok, so I have done some testing...

I can safely reduce the TCP/IP stack, but this is not he problem.

The problem is the TX/RX buffer size are not shown in the task stack usage, I just noticed the high water go crazy. We only send or receive 256 bytes but it has allocated 4K in and 4K out buffers!

RCTS.jpg

0 Kudos
Reply
1,280 Views
DavidS
NXP Employee
NXP Employee

Hi Carl,

Not certain if this solves the issue but...

Hands-on Workshop: Tower System Solutions, Part 3: Optimizing and Configuring an MQX™ RTOS, Intermed...FTF-ENT-F0081Enabling TechnologiesOperating SystemsHands-on Workshop

PDF

The above is from our www.freescale.com/ftf link, click on America's and then Technical Sessions Library.

The general rule of thumb for task stack space is start big and reduce "carefully".

If you have a IDE with TAD (task aware debugging), after running the application through its paces, you can look at the stack space used to get idea of how to adjust.

Regards,

David

0 Kudos
Reply