Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

µC/TCP-IP is configurable at compile time via approximately 70 #defines in the application’s net_cfg.h file. µC/TCP-IP uses #defines because they allow code and data sizes to be scaled at compile time based on enabled features and the configured number of network objects. This allows the ROM and RAM footprints of µC/TCP-IP to be adjusted based on application requirements.

Most of the #defines should be configured with the default configuration values. A handful of values may likely never change because there is currently only one configuration choice available. This leaves approximately a dozen values that should be configured with values that may deviate from the default configuration.

It is recommended that the configuration process begins with the default configuration values which in the next sections will be shown in bold.

The sections in this chapter are organized following the order in µC/TCP-IP's template configuration file, net_cfg.h.

Compile Features

ConstantDescriptionPossible Values
NET_CFG_OPTIMIZE_ASM_EN

Select portions of µC/TCP-IP code may call optimized assembly functions by configuring NET_CFG_OPTIMIZE_ASM_EN to DEF_ENABLED.

If optimized assembly files/functions are included in the µC/TCP-IP build set NET_CFG_OPTIMIZE_ASM_EN to DEF_NEABLED.

Set to DEF_DISABLED otherwise.

DEF_ENABLED or DEF_DISABLED

Debug Features

ConstantDescriptionPossible Values
NET_DBG_CFG_MEM_CLR_ENIs used to clear internal network data structures when allocated or de-allocated. By clearing, all bytes in internal data structures are set to ‘0’ or to default initialization values. This configuration is typically set it to DEF_DISABLED unless the contents of the internal network data structures need to be examined for debugging purposes. Having the internal network data structures cleared generally helps to differentiate between “proper” data and “pollution”.DEF_ENABLED or DEF_DISABLED
NET_DBG_CFG_TEST_ENIs used internally for testing/debugging purposes.DEF_ENABLED or DEF_DISABLED

Argument Check

Most functions in µC/TCP-IP include code to validate arguments that are passed to it. Specifically, µC/TCP-IP checks to see if passed pointers are NULL, if arguments are within valid ranges, etc. The following constants configure additional argument checking.

ConstantDescriptionPossible Values
NET_ERR_CFG_ARG_CHK_EXT_ENAllows code to be generated to check arguments for functions that can be called by the user and, for functions which are internal but receive arguments from an API that the user can call. Also, enabling this check verifies that µC/TCP-IP is initialized before API tasks and functions perform the desired function.DEF_ENABLED or DEF_DISABLED
NET_ERR_CFG_ARG_CHK_DBG_ENAllows code to be generated which checks to make sure that pointers passed to functions are not NULL, and that arguments are within range, etc.DEF_ENABLED or DEF_DISABLED

Counter Management

µC/TCP-IP contains code that increments counters to keep track of statistics such as the number of packets received, the number of packets transmitted, etc. Also, µC/TCP-IP contains counters that are incremented when error conditions are detected.

ConstantDescriptionPossible Values
NET_CTR_CFG_STAT_ENDetermines whether the code and data space used to keep track of statistics will be included.DEF_ENABLED or DEF_DISABLED
NET_CTR_CFG_ERR_ENDetermines whether the code and data space used to keep track of errors will be included.DEF_ENABLED or DEF_DISABLED

Timer Management

µC/TCP-IP manages software timers used to keep track of timeouts and execute callback functions when needed.

ConstantDescriptionPossible Values
NET_TMR_CFG_NBR_TMRDetermines the number of timers that µC/TCP-IP will be managing. Refer to section ### for more details on timer configuration.Depends on TCPIP stack configuration.
NET_TMR_CFG_TASK_FREQDetermines how often (in Hz) network timers are to be updated. This value must not be configured as a floating-point number.

Typically set to 10 Hz

Interfaces

ConstantDescriptionPossible Values
NET_IF_CFG_MAX_NBR_IFDetermines the maximum number of network interfaces that µC/TCP-IP may create at run-time.1 if a single network interface is present.
NET_IF_CFG_LOOPBACK_ENDetermines whether the code and data space used to support the loopback interface for internal-only communication only will be included.DEF_ENABLED or DEF_DISABLED
NET_IF_CFG_ETHER_ENDetermines whether the code and data space used to support Ethernet interfaces and devices will be included.DEF_ENABLED or DEF_DISABLED
NET_IF_CFG_WIFI_ENDetermines whether the code and data space used to support wireless interfaces and devices will be included.DEF_ENABLED or DEF_DISABLED
NET_IF_CFG_TX_SUSPEND_TIMEOUT_MSConfigures the network interface transmit suspend timeout value. The value is specified in integer milliseconds.1u

Address Resolution Protocol (ARP)

ARP is only required with IPv4.

ConstantDescriptionPossible Values
NET_ARP_CFG_CACHE_NBRConfigures the number of ARP cache entries. 

Neighbor Discovery Protocol (NDP)

NDPis only required with IPv6.

ConstantDescriptionPossible Values
NET_NDP_CFG_CACHE_NBR  
NET_NDP_CFG_DEST_NBR  
NET_NDP_CFG_PREFIX_NBR  
NET_NDP_CFG_ROUTER_NBR  

IPv4 Layer

ConstantDescriptionPossible Values
NET_IPv4_CFG_ENEnables the IPv4 module. 
NET_IPv4_CFG_IF_MAX_NBR_ADDRDetermines the maximum number of IPv4 addresses that may be configured per network interface at run-time.At least 1

IPv6 Layer

ConstantDescriptionPossible Values
NET_IPv6_CFG_ENEnables the IPv6 module. 
NET_IPv6_CFG_IF_MAX_NBR_ADDRDetermines the maximum number of IPv6 addresses that may be configured per network interface at run-time.At least 2

Internet Group Management Protocol (IGMP)

ConstantDescriptionPossible Values
NET_MCAST_CFG_IPv4_RX_EN  
NET_MCAST_CFG_IPv4_TX_EN  
NET_MCAST_CFG_HOST_GRP_NBR_MAXConfigures the maximum number of IGMP host groups that may be joined at any one time. 

Socket Layer 

ConstantDescriptionPossible Values
NET_SOCK_CFG_SOCK_NBR_TCP  
NET_SOCK_CFG_SOCK_NBR_UDP  
NET_SOCK_CFG_SEL_EN  
NET_SOCK_CFG_CONN_ACCEPT_Q_SIZE_MAX  
NET_SOCK_CFG_RX_Q_SIZE_OCTET  
NET_SOCK_CFG_TX_Q_SIZE_OCTET  

TCP Layer

ConstantDescriptionPossible Values
NET_TCP_CFG_EN  

UDP Layer

ConstantDescriptionPossible Values
NET_UDP_CFG_RX_CHK_SUM_DISCARD_EN  
NET_UDP_CFG_TX_CHK_SUM_EN  

Security Manager

ConstantDescriptionPossible Values
NET_SECURE_CFG_EN  
NET_SECURE_CFG_MAX_NBR_SOCK_SERVER  
NET_SECURE_CFG_MAX_NBR_SOCK_CLIENT  
NET_SECURE_CFG_MAX_CERT_LEN  
NET_SECURE_CFG_MAX_KEY_LEN  
NET_SECURE_CFG_MAX_NBR_CA  
NET_SECURE_CFG_MAX_CA_CERT_LEN  
  • No labels