Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 3.03.00

This section gives more details on how to configure a network interface for µCμC/TCP-IP.

Table of Contents

...

In transmission, the situation is different. The TCP/IP stack knows how much data is being transmitted. In addition to RAM being limited in embedded systems, another feature is the small amount of data that needs to be transmitted. For example, in the case of sensor data to be transmitted periodically, a few hundred bytes every second can be transferred. In this case, a small buffer can be used and save RAM instead of waste a large transmit buffer. Another example is the transmission of TCP acknowledgment packets, especially when they are not carrying any data back to the transmitter. These packets are also small and do not require a large transmit buffer. RAM is also saved.

 

µC/TCP-IP requires that network buffer sizes configured in net_dev_cfg.c satisfy the minimum and maximum packet frame sizes of network interfaces/devices.

...

The following table shows how each network buffer should be configured to handle the majority of worst cases.

Network Buffer

Type of

network buffer

Size

Receive Large Buffer

1518 + Alignment

Transmit Large Buffer

1518 + Alignment

Transmit Small Buffer

64 + Alignment

Network Device Configuration

All µCμC/TCP-IP device drivers require a configuration structure for each device that must be compiled into your driver. You must place all device configuration structures and declarations within a pair of files named net_dev_cfg.c and net_dev_cfg.h.

...

Ethernet Device Configuration

Listing - Ethernet Device Configuration shows a sample Ethernet configuration structure for Ethernet devices.

Ethernet PHY Configuration

Listing - Ethernet PHY Configuration shows a typical Ethernet PHY configuration structure.

Wireless Device Configuration

The listing below shows a sample wireless configuration structure for wireless devices.

Loopback Configuration

Configuring the loopback interface requires only a memory configuration, as described in µC/TCP-IP Network Interface Configuration.

Listing 5-9 shows a sample configuration structure for the loopback interface.

Adding a Loopback Interface

Basically, to enable and add the loopback interface you only have to enable the loopback interface within the network configuration See Network Interfaces Configuration.

Network Queues Configuration

The device configuration will directly impact the Network Task Queues Configuration.

The µC/TCP-IP stack includes two queues.

...

 The first one is the Rx queue and is used to store the Rx buffer that have been filled and are ready to be process. The second queue is the Tx deallocation and is used to store the Tx buffers that are ready to be deallocate.

The size of the Rx queue should reflects the total number of DMA receive descriptors configured for all the interfaces. If the devices are not DMA-based, it should reflects the maximum number of packets that can be acknowledged and signaled during a single receive interrupt even for all interfaces.

The size of the Tx queue should be defined as the total number of small and large transmit buffers declared for all interfaces.

Please refer to section Task Queue Configuration for more details.