Ethernet

The phyCORE-AM57x has two external Ethernet ports. These gigabit ethernet links are provided via the ETH0 and ETH1 RJ45 connectors on the phyCORE-AM57x development kit. This guide shows you how to connect and use these interfaces. To learn more information about the phyCORE-AM57x ethernet serial interface, please section 8.2 in the Hardware Manual.

../_images/pb-057948_eth-callout.png

Note

If a valid connection between the phyCORE-AM57x development kit and your network is made before boot-up then the kernel will automatically secure a connection and you will be assigned an ip address from the DHCP Server.

Requirements

  • CAT5e cable (comes included with the development kit)

  • Network switch connected to a DHCP enabled network

Network Connection Block Diagram

Ethernet Connection

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

Expected Output
root@phycore-am57xx-1:~# [ 2106.744689] cpsw-switch 48484000.switch eth0: Link is Up - 1Gbps/Full - flow control off
[ 2106.752868] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
  • 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@phycore-am57xx-1:~# ping google.com -c 10
PING google.com (142.250.217.110): 56 data bytes
64 bytes from 142.250.217.110: seq=0 ttl=57 time=5.799 ms
64 bytes from 142.250.217.110: seq=1 ttl=57 time=5.004 ms
64 bytes from 142.250.217.110: seq=2 ttl=57 time=5.066 ms
64 bytes from 142.250.217.110: seq=3 ttl=57 time=5.615 ms
64 bytes from 142.250.217.110: seq=4 ttl=57 time=5.035 ms
64 bytes from 142.250.217.110: seq=5 ttl=57 time=5.127 ms
64 bytes from 142.250.217.110: seq=6 ttl=57 time=5.035 ms
64 bytes from 142.250.217.110: seq=7 ttl=57 time=5.005 ms
64 bytes from 142.250.217.110: seq=8 ttl=57 time=5.066 ms
64 bytes from 142.250.217.110: seq=9 ttl=57 time=5.126 ms

--- google.com ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 5.004/5.187/5.799 ms

Finding the 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@phycore-am57xx-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: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 5c:f8:21:0e:33:ba brd ff:ff:ff:ff:ff:ff
    inet 129.163.8.11/24 brd 129.163.8.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.0.0.222/24 brd 10.0.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5ef8:21ff:fe0e:33ba/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 5c:f8:21:0e:33:bb brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
    link/can
6: can1: <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 ETH0 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 ETH1.

  • 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-AM57x

Once the phyCORE-AM57x’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-AM57x 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-AM57x 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
    Warning: Permanently added '10.0.0.222' (ECDSA) to the list of known hosts.
     ____   _   _ __   __ _____  _____   ____
    |  _ \ | | | |\ \ / /|_   _|| ____| / ___|
    | |_) || |_| | \ V /   | |  |  _|  | |
    |  __/ |  _  |  | |    | |  | |___ | |___
    |_|    |_| |_|  |_|    |_|  |_____| \____|
    
    __   __  ___    ____  _   _  ____   _____
    \ \ / / / _ \  / ___|| | | ||  _ \ |_   _|
     \ V / | | | || |  _ | | | || |_) |  | |
      | |  | |_| || |_| || |_| ||  _ <   | |
      |_|   \___/  \____| \___/ |_| \_\  |_|
    
    
    Yogurt (Phytec Base Distribution) BSP-Yocto-AM57x-PD23.1.0
    
    root@phycore-am57xx-1:~#
    
  • Leave ssh session with an “exit” command.

    Host (Ubuntu)
     exit
    

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

  • A final place to troubleshoot network related issues between the phyCORE-AM57x 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-057948_eth-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.