Memory Requirements

Stack and Heap

Minimum stack size should be 1024 words. Minimum heap size depends on configuration. By default 3500 words of heap are necessary, but up to 2500 words can optionally be placed into bss section when neccessary.


All other memories (buffers, etc.) are user-defined and application specific and may be allocated statically or dynamically.


netlib Code Section

The net.lib library uses two special code sections:

  • .nettextfast
  • .nettextslow

Performance critical functions are located in .nettextfast and should be mapped to fastest memory in the linker command file. .nettextslow can be linked to slower memory without noticeable performance penalties.


Example linker command instructions

Example linker command file: Refer to Example Linker Command File

Definition in application linker command file App.cmd:

#define NETSECFAST RAML1
#define NETSECSLOW POFFCHIP
SECTIONS
{
/* link the fast netlib code to internal memory for maximum speed */
/* .net_smc91c1x { -lnet.lib<smc91c1x.obj>(.nettextfast) } > PROG , PAGE = 0 */
/* .net_memb { -lnet.lib<memb.obj>(.nettextfast) } > PROG , PAGE = 0 */
/* .net_ip { -lnet.lib<ip.obj>(.nettextfast) } > PROG , PAGE = 0 */
/* .net_socket { -lnet.lib<socket.obj>(.nettextfast) } > PROG , PAGE = 0 */
/* .net_tcp { -lnet.lib<tcp.obj>(.nettextfast) } > PROG , PAGE = 0 */
/* .net_udp { -lnet.lib<udp.obj>(.nettextfast) } > PROG , PAGE = 0 */
.nettextfast > NETSECFAST , PAGE = 0 /* fast netlib code */
.nettextslow > NETSECSLOW , PAGE = 0 /* slow netlib code */
}
#include "../../../Libs/Netlib/net.cmd"


Memory assignment in netlib linker command file \Libs\Netlib\net.cmd by using previous definition:

.nettextfast > NETSECFAST /* fast netlib code */
.nettextslow > NETSECSLOW /* slow netlib code */




Common Modules Code Section

The Common Support Modules included with the Support SW can also be linked to external memory, since no time-critical function is defined within these modules. Use the following linker instruction to link these modules to external memory:


Definition in application linker command file App.cmd:

/* #define COMMONSECTIONS RAML7 */
#define COMMONSECTIONS POFFCHIP /* all common modules linked to external RAM */
SECTIONS
{
/*------------------------------------------------------------------------*/
/* Support functions */
/*------------------------------------------------------------------------*/
.uarttext > COMMONSECTIONS ,PAGE = 0 /* UART code */
.cprintftext > COMMONSECTIONS ,PAGE = 0 /* CPrintf section */
.commontext > COMMONSECTIONS ,PAGE = 0 /* common code */
}


Memory assignment in linker command file \Common\CommonSections.cmd by using previous definition:

SECTIONS
{
/*------------------------------------------------------------------------*/
/* Support functions */
/*------------------------------------------------------------------------*/
.uarttext > COMMONSECTIONS /* UART code */
.cprintftext > COMMONSECTIONS /* CPrintf section */
.commontext > COMMONSECTIONS /* common code */
}




Code and Data Size

Required Code and Data size depends on used protocols and sockets:

CCS5.5, CGTools 16.9.10, netlib 2.92.03
Code Size:
Adapter + MAC + PHY 3568 words
ARP 1031 words
Sockets 3514 words
IP 711 words
ICMP 457 words
UDP 691 words
TCP 4356 words
DNS 418 words
DHCP 1472 words
Stack Size: 1024 words
Heap Size:
Adapter/PHY 118 words
per UDP/ICMP Socket 256 words
per TCP Socket 82 words
optional on heap or static
Socket send FIFO 768 words
TCP send seq numbers 1152 words
ARP list entries 540 words