Ethernet

Gigabit Ethernet links are provided via the ETH0 and ETH1 RJ45 connectors on the phyCORE-AM62Ax development kit. This guide shows you how to connect and use these interfaces. To learn more information about the phyCORE-AM62Ax ethernet serial interface, please section 7.2 in the Hardware Maunal.

phyCORE-AM62Ax Ethernet

Requirements

  • CAT5e cable (comes included with the development kit)

  • Network switch connected to a DHCP enabled network

Establishing a Connection

If a valid connection between the phyCORE-AM62Ax development kit and a DHCP enabled network is made then the phyCORE-AM62Ax will automatically negotiate a connection and will be assigned a unique IPv4 address.

Expected Output
root@phyboard-lyra-am62axx-1:~# [ 2332.082057] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
  • After the connection is established, you can try the following command to ping a host. We’ll ping google.com in this example:

Target (Linux)
ping google.com -c 10
Expected Output
root@phyboard-lyra-am62axx-1:~# 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-AM62Ax’s IPv4 address

  • To view the IP address assigned to your device’s network interfaces, use the following command:

Target (Linux)
ip addr
Expected Output
root@phyboard-lyra-am62axx-1:~# 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 34:08:e1:80:89:5f brd ff:ff:ff:ff:ff:ff
inet6 fe80::3608:e1ff:fe80:895f/64 scope link
  valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 5a:44:c1:60:d6:ea brd ff:ff:ff:ff:ff:ff
inet 129.777.4.11/24 brd 129.777.4.255 scope global eth1
  valid_lft forever preferred_lft forever
inet 10.0.0.222/24 brd 10.0.0.255 scope global dynamic eth1
  valid_lft 86305sec preferred_lft 86305sec
inet6 fe80::5844:c1ff:fe60:d6ea/64 scope link
  valid_lft forever preferred_lft forever
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
link/can
  • In the above example, we can see that ETH1 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-eth1.network to edit ETH1.

    Target (Linux)
    vi /lib/systemd/network/10-eth1.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.

Expected Output
[Match]
Name=eth1

[Network]
DHCP=True
  • Reboot the system.

    Target (Linux)
    reboot
    
  • View the DHCP IPv4 address assigned to your device.

    Target (Linux)
    ip addr
    

SSH into the phyCORE-AM62Ax

Once the phyCORE-AM62Ax’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-AM62Ax 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:

    Host (Ubuntu)
     sudo apt-get update
     sudo apt-get install ssh
    
  • The phyCORE-AM62Ax 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:

    Host (Ubuntu)
    Expected Output
    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:ERfYI41VP/hXh17ulInjqWq5wIn4D2mO69H8PILHmW8.
    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 2021.09
    
    root@phyboard-lyra-am62axx-1:~#
    

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-AM62Ax target.

  • A final place to troubleshoot network related issues between the phyCORE-AM62Ax 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:

../_images/pb-07124_VMsetting.jpg

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.