Configuration of the Ethernet interface in µVision.
Configuration of the Ethernet interface in µVision.
The Ethernet interface is configured using the Net_Config_ETH_n.h file. n stands for the number of the Ethernet interface. In general, most microcontrollers will have one Ethernet interface, thus the configuration file will be Net_Config_ETH_0.h. The options are set in the file directly or using the Configuration Wizard.
Ethernet Interface Configuration File
The Ethernet configuration file contains the following settings:
- Connect to hardware via Driver_ETH# defines the number of the Ethernet MAC peripheral on the microcontroller device to be used. Unless it contains multiple Ethernet MACs, this should always be "0".
- MAC Address specifies the six byte Ethernet MAC address of the device. It must be unique for each Ethernet controller that is part of a LAN. The value FF:FF:FF:FF:FF:FF is not allowed. During mass-production, this value needs to be changed for every single device that is manufactured using the Runtime Configuration.
- To use VLAN, enable the check box.
- VLAN Identifier is a unique 12-bit number, that identifies the virtual LAN number to which the interface is connected.
- To use IPv4, enable the check box.
- IP Address specifies a static local 4 bytes IP address. The value 255.255.255.255 is not allowed. This IP address is only used by the device if the Dynamic Host Configuration is disabled. If DHCP is enabled, the IP address is obtained automatically from the DHCP server or an AutoIP is used. A static IP address can also be changed at runtime.
- Subnet mask defines the net mask. The value of the net mask has to to be in line with the above specified IP address.
- Default Gateway specifies the IP address of the default gateway. It is used when accessing the external WAN. If the application is used on a local LAN only, then the value is irrelevant.
- Primary DNS Server specifies the IP address of the primary DNS server. The DNS Client sends IP address resolution requests to this address. The setting is irrelevant if the DNS Client is disabled.
- Secondary DNS Server specifies the IP address of the secondary DNS server. It is used if the primary DNS server is down or not accessible. In this case, the DNS Client automatically switches to the secondary DNS server if a non-zero address is provided. The setting is irrelevant if the DNS Client is disabled.
- IP Fragmentation enables fragmentation of outgoing IP datagrams, and reassembling the fragments of incoming IP datagrams.
- ARP Definitions configures various parameters of the Address Resolution Protocol that is used to cache the IP addresses of remote peers.
- Cache Table size specifies the size of ARP cache table. It defines how many cache entries can be kept in the ARP cache. Increase this value when using multiple simultaneous IP connections.
- Cache Timeout in seconds specifies the timeout for an ARP cache entry. After a timeout, the Permanent IPs are refreshed, and the Temporary IPs are removed from the cache. The Timeout (Keep-alive) Timer is reset on every access to the cache entry.
- Number of Retries is the maximum number of retries to resolve the Ethernet MAC address of the remote peer.
- Resend Timeout in seconds specifies the waiting interval between two re-sends. When this timeout has expired and no response has been received from the remote peer, the ARP request is resent.
- Send Notification on Address changes enables or disables the Gratuitous ARP Service. When it is enabled, the embedded host will broadcast a Gratuitous ARP notification at startup, or when the local IP address has changed.
- IGMP Group Management enables or disables sending or receiving IP Multicast packets. In order to receive Multicast packets, a host must first join a Host Group with a specified Host Group IP address.
- Membership Table size specifies the size of IGMP Host Group table. It defines how many Host Groups a host can join.
- If the NetBIOS Name Service is enabled, the device can be accessed by its local host name in a LAN. For example: instead of
- If Dynamic Host Configuration is enabled, the device obtains all network parameters like IP address, net mask, default gateway, primary and secondary DNS servers automatically from the DHCP server on the LAN. Enable also the option NetBIOS Name Service to access the hardware by its name. DHCP requires UDP Sockets to be enabled as it uses one UDP socket for communication with the DHCP server.
- Vendor Class Identifier (VCI) specifies a string, which is added to the DHCP request message. The VCI can be used to selectively identify a device on a DHCP server (option 60). For example, the DHCP server can assign an IP address to a specific Vendor Class group and ignore all other DHCP clients with a different VCI.
- Bootfile Name enables or disables the DHCP option 67. If this option is enabled, a DHCP client requests also a Bootfile Name parameter from a DHCP server. When enabled, the user needs to provide a netDHCP_Notify callback function in his application.
- NTP Servers specifies that a list of NTP servers (option 42) is also requested from the DHCP server.
- To use IPv6, enable the check box.
- IPv6 Address specifies the static IP address in text representation. If no static IP address is assigned, use "::".
- In the Subnet prefix-length you can enter the number of bits that define the network address.
- Default Gateway specifies the IP address of the default gateway. It is used when accessing the external WAN. If the application is used on a local LAN only, then the value is irrelevant.
- Primary DNS Server specifies the IP address of the primary DNS server. The setting is irrelevant if the DNS Client is disabled.
- Secondary DNS Server specifies the IP address of the secondary DNS server. It is used if the primary DNS server is down or not accessible. The setting is irrelevant if the DNS Client is disabled.
- IPv6 Fragmentation enables fragmentation of outgoing IPv6 datagrams, and reassembling the fragments of incoming IPv6 datagrams.
- The Cache Table Size of the Neighbor Discovery sets the number of cached neighbor node addresses.
- The Cache Timeout in seconds specifies the timeout for cached node addresses.
- The Number of Retries is used to resolve an IP address before the NDP module gives up and stops the resolution.
- The Resend Timeout in seconds specifies the timeout for resending Neighbor Solicitation.
- If Dynamic Host Configuration is enabled, the device obtains all network parameters like IP address and primary/secondary DNS servers automatically from the DHCPv6 server on the LAN.
- Two DHCPv6 Client Modes are used to connect to a DHCPv6 server: in stateless mode, the client obtains only extended information from the DHCPv6 server, such as DNS server addresses. In stateful mode, the client connects to a DHCPv6 server for a leased IPv6 address and DNS server addresses.
- Vendor Class Option is used to send vendor information to the DHCPv6 server. This information can be used to selectively identify a device on a DHCPv6 server, similar to VCI in IPv4.
- Enterprise ID specifies Enterprise-number as assigned by IANA.
- Vendor Class Data specifies a string, which is added to the DHCPv6 request message.
- OS Resources Settings are used to optimize usage of OS resources.
- The default Interface Thread Stack Size is 512 bytes.
- The default Interface Thread priority is osPriorityAboveNormal. You can change this priority by changing the ETHn_THREAD_PRIORITY defined in this configuration file. This priority must be high enough for the Ethernet interface to respond to events in a timely manner. Due to this requirement, it is recommended that this setting remain the default. For more information on default settings, see the section CMSIS-RTOS Requirements.
Additional Ethernet configuration settings:
- The ETHn_ICMP_NO_ECHO defines the Echo response mode that is enabled by default. A value of 1 disables the echo response, and a value of 0 enables it. Alternatively, you can change it from a running application with the netICMP_SetNoEcho function.
- The ETHn_ICMP6_NO_ECHO defines the Echo response mode for IPv6 that is enabled by default. A value of 1 disables the echo response, and a value of 0 enables it. Alternatively, you can change it from a running application with the netICMP6_SetNoEcho function.