.. _Ethernet-62A: 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 `_. .. image:: ../../images/phycore-am62ax/pb-07524_ethernet.png :width: 800px :alt: 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. .. code-block:: none :caption: Expected Output root@phyboard-lyra-am62axx-2:~# [ 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: .. code-block:: none :caption: Target (Linux) ping google.com -c 10 .. code-block:: none :caption: Expected Output root@phyboard-lyra-am62axx-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-AM62Ax's IPv4 address ------------------------------------------ * To view the IP address assigned to your device's network interfaces, use the following command: .. code-block:: none :caption: Target (Linux) ip addr .. code-block:: none :caption: Expected Output root@phyboard-lyra-am62axx-2:~# ip addr 1: lo: 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: 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: 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: 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. .. code-block:: none :caption: 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. .. code-block:: none :caption: Expected Output [Match] Name=eth1 [Network] DHCP=yes * Reboot the system. .. code-block:: none :caption: Target (Linux) reboot * View the DHCP IPv4 address assigned to your device. .. code-block:: none :caption: 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: .. code-block:: none :caption: 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: .. code-block:: none :caption: Host (Ubuntu) ssh root@10.0.0.222 .. code-block:: none :caption: Expected Output user@ubuntu:~$ ssh root@10.0.0.222 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-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-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: .. image:: ../../images/phycore-am62x/pb-07124_VMsetting.jpg :width: 350px 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.