2.4. Setup Network

2.4.1. Overview

This section deals with setting up a wired network using an Ethernet cable. For information on setting up a wireless network using WiFi, please see the Setting Up WiFi section.

Most TI EVMs, including the AM64x GP EVM and the AM64x Starter Kit (SK) include support for wired networking using an Ethernet cable. The Processor SDK for Linux that runs on these EVMs also includes networking support right out of the box.

2.4.2. Using an Dedicated Router with DHCP

In order to use networking with the EVMs, a method to assign IP addresses is needed. The easiest, most cross-platform way to achieve this is to use an dedicated router that includes a DHCP server. The below diagram is a good example of a setup to use networking with an EVM and a dedicated router:

../_images/Academy_Eval_Network_Overview_Router.png

In this setup, the PC being used for evaluation is connected to a router that has a DHCP server configured to serve IP addresses on a certain subnet. The EVM is also connected to the same router. Like the PC, the EVM will attempt to get an IP address using DHCP at boot time. In this configuration, both the PC and the EVM should get an IP address from the router on the same subnet. This configuration will allow the EVM and PC to communicate over the network.

Here is a good command to run on the EVM, or target, to check the status of the network. In this example, the Starter Kit (SK) is not connected to any networks (no Ethernet cables plugged in).

root@am64xx-evm:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether f4:84:4c:f9:7c:17  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 70:ff:76:1d:f1:a3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 82  bytes 6220 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82  bytes 6220 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.43.1  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::3a0b:3cff:fef1:bc7a  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:7a  txqueuelen 1000  (Ethernet)
        RX packets 157  bytes 14522 (14.1 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 142  bytes 17619 (17.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The eth0 and eth1 interfaces above are the wired Ethernet interfaces on the Starter Kit (SK). These interfaces are connected to the Ethernet Switch (CPSW) on the AM64x SoC. This hardware block can support either a Switch or dual-MAC configuration. By default, the SDK configures the hardware in dual-MAC mode, and thus the two Linux interfaces, eth0 and eth1, corresponding to the two MACs.

Connecting a cable to the Starter Kit (SK) should start a connection and get an IP address from the DHCP server in the router. The status of the connection should change to having an IP address and can be validated with the same command as above in the SDK:

root@am64xx-evm:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.2.19  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::f684:4cff:fef9:7c17  prefixlen 64  scopeid 0x20<link>
        ether f4:84:4c:f9:7c:17  txqueuelen 1000  (Ethernet)
        RX packets 6  bytes 926 (926.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 41  bytes 5532 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        inet6 fe80::72ff:76ff:fe1d:f1a3  prefixlen 64  scopeid 0x20<link>
        ether 70:ff:76:1d:f1:a3  txqueuelen 1000  (Ethernet)
        RX packets 18  bytes 2462 (2.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 69  bytes 8138 (7.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 82  bytes 6220 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82  bytes 6220 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.43.1  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::3a0b:3cff:fef1:bc7a  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:7a  txqueuelen 1000  (Ethernet)
        RX packets 162  bytes 14732 (14.3 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 147  bytes 17969 (17.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The above output shows that eth0 now has an IP address, 192.168.2.19. This IP address will vary depending on the configuration of the DHCP server. If the other connector on the board was used, eth1 may have gotten an IP address like below:

root@am64xx-evm:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether f4:84:4c:f9:7c:17  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.2.26  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::72ff:76ff:fe1d:f1a3  prefixlen 64  scopeid 0x20<link>
        ether 70:ff:76:1d:f1:a3  txqueuelen 1000  (Ethernet)
        RX packets 13  bytes 1793 (1.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 33  bytes 5522 (5.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 82  bytes 6220 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82  bytes 6220 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.43.1  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::3a0b:3cff:fef1:bc7a  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:7a  txqueuelen 1000  (Ethernet)
        RX packets 160  bytes 14648 (14.3 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 145  bytes 17829 (17.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Once an IP address is assigned, connectivity can be checked with a simple “ping” command like below:

root@am64xx-evm:~# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: seq=0 ttl=64 time=0.432 ms
64 bytes from 192.168.2.1: seq=1 ttl=64 time=0.387 ms
64 bytes from 192.168.2.1: seq=2 ttl=64 time=0.431 ms
64 bytes from 192.168.2.1: seq=3 ttl=64 time=0.344 ms
64 bytes from 192.168.2.1: seq=4 ttl=64 time=0.386 ms
^C
--- 192.168.2.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.344/0.396/0.432 ms

Once IP connectivity is confirmed with a router, other networking learning and evaluation can continue. Feel free to try the Benchmark Demo or the Matrix Demo using wired networking.

2.4.3. Using an DHCP Server on a Linux PC

If a Linux PC is being used as the Development Host, it fairly easy to install and configure a DHCP server on the PC. This configuration removes the need for the separate router, but is a bit more complicated to set up. This setup allows the EVM to connect directly to the PC like the diagram below.

../_images/Academy_Eval_Network_Overview_DHCP.png

This configuration can have some benefits as it allows for more full control over the DHCP server and makes it possible to script certain operations related to the network interfaces. Installing and configuring a DHCP server is beyond the scope of this guide, but these instructions should be a good start.

If the DHCP Server and connection to the host are working correctly, an IP address should be acquired by the target EVM when connected to he host. The command below can be used to check for an IP address:

root@am64xx-evm:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.2.19  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::f684:4cff:fef9:7c17  prefixlen 64  scopeid 0x20<link>
        ether f4:84:4c:f9:7c:17  txqueuelen 1000  (Ethernet)
        RX packets 6  bytes 926 (926.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 41  bytes 5532 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        inet6 fe80::72ff:76ff:fe1d:f1a3  prefixlen 64  scopeid 0x20<link>
        ether 70:ff:76:1d:f1:a3  txqueuelen 1000  (Ethernet)
        RX packets 18  bytes 2462 (2.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 69  bytes 8138 (7.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 82  bytes 6220 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82  bytes 6220 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.43.1  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::3a0b:3cff:fef1:bc7a  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:7a  txqueuelen 1000  (Ethernet)
        RX packets 162  bytes 14732 (14.3 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 147  bytes 17969 (17.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In the output above, eth0 has been connected to the host and obtained an IP address, 192.168.2.19, from the DHCP server running on the host. This address will vary depending on the configuration of the DHCP server.

With an IP address obtained, a simple ping command from the target to the Host can be used to validate connectivity:

root@am64xx-evm:~# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: seq=0 ttl=64 time=0.432 ms
64 bytes from 192.168.2.1: seq=1 ttl=64 time=0.387 ms
64 bytes from 192.168.2.1: seq=2 ttl=64 time=0.431 ms
64 bytes from 192.168.2.1: seq=3 ttl=64 time=0.344 ms
64 bytes from 192.168.2.1: seq=4 ttl=64 time=0.386 ms
^C
--- 192.168.2.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.344/0.396/0.432 ms

Once IP connectivity is confirmed with a Host, feel free to try the Benchmark Demo or the Matrix Demo using wired networking.

2.4.4. Using Static IP Addresses

Another option for connecting an EVM to a Development Host is to simply use static IP address for each. Here are some commands to set a static IP address on the target EVM. Please note that the IP address set should be compatible with the host and may vary from the example:

ip link set dev eth0 down
ip addr add 192.168.2.25/24 dev eth0
ip link set dev eth0 up

Setting the IP address on the host is beyond the scope of this guide, but this link should be helpful.

For the host and target to communicate, the IP addresses used must be on the same subnet. The “ping” command can be used to check connectivity, much like the DHCP cases above.

With connectivity established, feel free to try to run the Benchmark Demo or the Matrix Demo using the wired network.