Keil™, An ARM® Company

Technical Support

RL-ARM: REDUCE MEMORY FOOTPRINT OF TCP/IP STACK


Information in this article applies to:

  • RL-ARM Version 3

QUESTION

I am running the TCP/IP stack on the Atmel AT91SAM7X device and I need to minimize the RAM occupation of TCP/IP stack. Can we do this by changing the header files?

The traffic in our TCP/IP network will be quite low, therefore I would like to reduce the RAM requirements as much as possible.

ANSWER

Yes. It is possible to reduce the RAM footprint by changing the definitions in the files AT91_EMAC.H and Net_Config.C.

  • In the file AT91_EMAC.H the configuration:
    /* EMAC Memory Buffer configuration. */
    #define NUM_RX_BUF          64
    
    defines the receive buffer size to be 8KB. This buffer might be reduced to 4KB (NUM_RX_BUF = 32) or even to 2KB (NUM_RX_BUF = 16). Reduction to 16 (or below) may cause problems and should be tested on the real network. Note that the size value of the NUM_RX_BUF must be a power of 2.
  • In the file Net_Config.c the memory pool for dynamic memory allocation can be reduced. Reduction to down to 4096 (= 4KB) is safe and should have no impact on the operation of the TCPnet system. You may change this using the Configuration Wizard (TCPnet System Definitions - MEM_SIZE) or directly in the source code (by changing the #define MEM_SIZE). When your LAN traffic is really low, the MEM_SIZE definition could be reduced even more to get lower RAM usage.

MORE INFORMATION

  • RL-ARM User's Guide, TCPnet, Configuring TCPnet

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, November 19, 2008


Did this article provide the answer you needed?