Memory Requirements

Stack and Heap

Minimum stack size should be 2048 bytes, minimum heap size should be at least 2048 bytes.


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 IRAM
#define NETSECSLOW SDRAM
#include "../../../Libs/Netlib/net.cmd"


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

SECTIONS
{
.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 IRAM all common modules linked to internal RAM */
#define COMMONSECTIONS SDRAM /* all common modules linked to external RAM */
#include "../../../Common/CommonSections.cmd"


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 7.4.23, netlib 2.91
Code Size:
Adapter + MAC + PHY 24032 bytes
ARP 4768 bytes
Sockets 15040 bytes
IP 3552 bytes
ICMP 2496 bytes
UDP 3488 bytes
TCP 20128 bytes
DNS 2304 bytes
DHCP 8320 bytes
Stack Size: 2048 bytes
Heap Size:
Adapter/PHY 260 bytes
per UDP/ICMP Socket 504 bytes
per TCP Socket 660 bytes
Static RAM:
ARP Cache 2448 bytes
TCP sequence number cache 5168 bytes