Ethernet
The phyCORE-AM64x SOM brings out five external 10/100/1000 Mbps Ethernet ports (the AM64xx processor has six internal ethernet ports, but two share the same pins and can’t be used simultaneously, CPSW_RGMII2 and PRG1_RGMII2). One ethernet port is translated by a DP83867IRRGZ ethernet PHY into differential ethernet data pairs and supports 10-BASE-Te, 100BASE-TX, and 1000BASE-T protocols, while the other four are brought out as RGMII/RMII or MII through CPSW_RGMII1/2, PRG0_RGMII1/2 or PRG1_RGMII1/2.
The development kit provides three easy to access gigabit ethernet links that are provided via the ETH0, ETH1 and ETH2 RJ45 connectors on the phyCORE-AM64x development kit. This guide shows you how to connect and use these interfaces. To learn more information about the phyCORE-AM64x ethernet serial interface, please see section 7.2 in the Hardware Manual.
Requirements
In order to follow this guide and exercise the networking capabilities of the phyCORE-AM64x, you will require the following:
CAT5e cable (included with development kit)
Network switch connected to a DHCP enabled network
Establishing a Connection
If a valid connection between the phyCORE-AM64x development kit and a DHCP enabled network is made before boot-up then the phyCORE-AM64x will automatically negotiate a connection and will be assigned a unique IPv4 address.
Once booted into Linux, you can try the following command to ping a host. We’ll ping google.com in this example:
ping google.com -c 10
root@phyboard-electra-am64xx-2:~# ping google.com -c 10
PING google.com (172.217.14.238): 56 data bytes
64 bytes from 172.217.14.238: seq=0 ttl=59 time=14.443 ms
64 bytes from 172.217.14.238: seq=1 ttl=59 time=14.408 ms
64 bytes from 172.217.14.238: seq=2 ttl=59 time=15.254 ms
64 bytes from 172.217.14.238: seq=3 ttl=59 time=14.340 ms
64 bytes from 172.217.14.238: seq=4 ttl=59 time=14.314 ms
64 bytes from 172.217.14.238: seq=5 ttl=59 time=13.420 ms
64 bytes from 172.217.14.238: seq=6 ttl=59 time=13.306 ms
64 bytes from 172.217.14.238: seq=7 ttl=59 time=18.276 ms
64 bytes from 172.217.14.238: seq=8 ttl=59 time=15.265 ms
64 bytes from 172.217.14.238: seq=9 ttl=59 time=16.178 ms
--- google.com ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 13.306/14.920/18.276 ms
Finding the phyCORE-AM64x’s IPv4 address
To view the IP address assigned to your device’s network interfaces, use the following command:
ip addr
root@phyboard-electra-am64xx-2:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether ac:1f:0f:84:02:fc brd ff:ff:ff:ff:ff:ff
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
link/can
4: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
link/can
5: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 1a:c6:45:51:c7:58 brd ff:ff:ff:ff:ff:ff
inet6 fe80::18c6:45ff:fe51:c758/64 scope link
valid_lft forever preferred_lft forever
6: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ca:74:6c:8d:53:d6 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.222 brd 10.0.0.255 scope global dynamic eth2
valid_lft 86376sec preferred_lft 86376sec
inet6 fe80::c874:6cff:fe8d:53d6/64 scope link
valid_lft forever preferred_lft forever
In the above example, we can see that ETH2 was assigned the IPv4 address 10.0.0.222 and the other ethernet interfaces should behave similarly.
Changing Static IPv4 Address to DHCP
Regularly the IPv4 address assigned to your device is a static one. This limits the devices abilities. Abilities such as being remote accessed into with SSH. The following steps will show how to change the IPv4 address from static to DHCP for ETH2.
Edit the file /lib/systemd/network/10-eth2.network to edit ETH2.
vi /lib/systemd/network/10-eth2.network
Change DHCP to equal “True” and remove the “Address=XXX.X.X.XXX” line.
Note
The vi text editor begins in “Command Mode” and you must first hit the ‘i’ key in order to enter “Insert Mode”. Using the arrow keys to navigate, make the necessary changes and then hit ESC to go back to “Command mode”. Now enter “:wq” to write the file and quit.
Pro Tip: Use the right click on your mouse to paste! This will only work if you are in “Insert Mode” first.
[Match]
Name=eth2
[Network]
DHCP=yes
Reboot the system.
reboot
View the DHCP IPv4 address assigned to your device.
ip addr
SSH into the phyCORE-AM64x
Once the phyCORE-AM64x’s IPv4 address is known, we can use it to interact with the development kit over the network. This section of the guide will walk through establishing an SSH connection with the hardware which can be a handy way to quickly get a second terminal session up and running. This might be useful if you are doing development directly on the target and need to process a second task in parallel with something running in the standard hardware UART console.
In order to most easily follow this section of the guide, you will want both the phyCORE-AM64x and your Ubuntu host machine connected to the same local area network (LAN).
Note
A Windows Command Prompt can be used instead of a Linux machine. Just skip the following update commands.
Using your Ubuntu Host Machine, start a new Terminal session and use the following command to ensure that ssh is installed:
sudo apt-get update
sudo apt-get install ssh
sudo apt install net-tools
The phyCORE-AM64x Linux BSP has a ssh server installed and enabled by default so it is already pre-configured to accept ssh connections. Establish a connection with the development kit using the Ubuntu host machine:
The first time you SSH into the development kit you will probably be prompted to add the target to a list of known hosts:
user@ubuntu:~$ ssh [email protected]
The authenticity of host '10.0.0.222 (10.0.0.222)' can't be established.
RSA key fingerprint is SHA256:J3LFEy36emULp5CpAjmgqPHAJdOJUYb+jGe4JbCMnsY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.222' (RSA) to the list of known hosts.
_____ _____ _ _
| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
| | _| .'| . | . | | __| _| . | | | -_| _| _|
|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
|___| |___|
Arago Project http://arago-project.org
Arago (Phytec-TI Distribution + Package Management) 2020.09
root@phyboard-electra-am64xx-2:~#
Note
If you are having trouble establishing an SSH connection with the development kit:
Double check that the development kit is actually connected to the network by pinging a known host such as google.com in the target console.
Another common thing that trips up people is having a VPN enabled, which can cause your Host Machine to not find the phyCORE-AM64x target.
A final place to troubleshoot network related issues between the phyCORE-AM64x and the Ubuntu Host Machine is the network adapter settings, especially if you are using a Virtual Machine to host Ubuntu. In VMWare Workstation, the Virtual Machine’s Network Adapter settings look like the following:
The network setting will likely have NAT selected by default and this should work for most development tasks. Switching this to Bridged and replicating a physical connection can sometimes help resolve problems depending on what you are trying to do.
Feel free to reach out at PHYTEC’s Support Portal if you have any questions or concerns.