Ethernet
The phyBOARD-Lyra AM62x has 2 external gigabit ethernet ports. All interfaces offer a standard Linux network port that can be programmed using the BSD socket interface. The whole network configuration is handled by the systemd-networkd daemon. The relevant configuration files can be found on the target in /lib/systemd/network/ as well as the BSP in meta-ampliphy/recipes-core/systemd/systemd-conf. To learn more information about the phyCORE-AM62x ethernet serial interface, please see the networking section in the Hardware Manual.
![phyCORE-AM62x Ethernet](../_images/pb-07124_ethernet.webp)
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 phyBOARD-Lyra AM62x and a DHCP enabled network is made then the phyBOARD-Lyra AM62x will automatically negotiate a connection and will be assigned a unique IPv4 address.
By default, the network configuration supports both DHCP and static IP addressing simultaneously through systemd-networkd. The default static IP address is configured as 192.168.4.11/24. This dual configuration allows the interface to obtain a DHCP address while maintaining the static fallback address, ensuring connectivity in various network environments.
The network configuration is managed by systemd-networkd and allows:
Automatic IP address assignment via DHCP
Static IP fallback (192.168.4.11/24)
Multiple IP addresses on the same interface
Parallel operation of DHCP and static configuration
[ 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 8.8.8.8 which is the primary DNS server for Google DNS in this example:
phyboard-lyra-am62xx-3:~# ping 8.8.8.8 -c 10
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=250 time=39.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=250 time=39.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=250 time=38.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=250 time=39.0 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=250 time=39.1 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=250 time=47.1 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=250 time=52.4 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=250 time=40.2 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=250 time=41.0 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=250 time=39.5 ms
--- 8.8.8.8 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9010ms
rtt min/avg/max/mdev = 38.644/41.557/52.433/4.318 ms
Show assigned IP addresses
To view the IP address assigned to your device’s network interfaces, use the following command:
phyboard-lyra-am62xx-3:~# 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
Changing Static IPv4 Address
There are two ways to modify the static IP address configuration:
Runtime Configuration
To change the static IP address on the running system:
Edit the network configuration file:
phyboard-lyra-am62xx-3:~# vi /lib/systemd/network/10-eth0.network
Modify the Address line under the [Network] section:
[Network] Address=192.168.3.11/24
Restart the network service:
phyboard-lyra-am62xx-3:~# systemctl restart systemd-networkd
Build-time Configuration
To permanently change the default static IP:
Edit the network configuration in your BSP layer:
meta-ampliphy/recipes-core/systemd/systemd-conf/10-eth0.network
Update the Address line as shown above
Rebuild the BSP image
SSH into the Board
Once the phyBOARD-Lyra AM62x 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 phyBOARD-Lyra AM62x and your Ubuntu host machine connected to the same local area network (LAN).
Using your Ubuntu host machine, start a new terminal session and use the following command to ensure that ssh is installed:
sh-host:~$ sudo apt update sh-host:~$ sudo apt install ssh
The phyBOARD-Lyra AM62x 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:
sh-host:~$ 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. ____ _ _ __ __ _____ _____ ____ | _ \ | | | |\ \ / /|_ _|| ____| / ___| | |_) || |_| | \ V / | | | _| | | | __/ | _ | | | | | | |___ | |___ |_| |_| |_| |_| |_| |_____| \____| _ __ __ ____ _ ___ ____ _ _ __ __ / \ | \/ || _ \ | | |_ _|| _ \ | | | |\ \ / / / _ \ | |\/| || |_) || | | | | |_) || |_| | \ V / / ___ \ | | | || __/ | |___ | | | __/ | _ | | | /_/ \_\|_| |_||_| |_____||___||_| |_| |_| |_| ampliPHY (Phytec Distribution) BSP-Yocto-Ampliphy-AM62x-PD24.1.1 phyboard-lyra-am62xx-3 ttyS2 phyboard-lyra-am62xx-3:~#
Benchmarking Network Performance
The iperf3 utility is pre-installed to measure network throughput. Here’s how to use it:
Server Mode
On the target board, start iperf3 in server mode:
phyboard-lyra-am62xx-3:~# iperf3 -s
Client Mode
On another machine in your network, install iperf3 and run it in client mode:
sh-host:~$ iperf3 -c 192.168.4.11
This will run a 10-second throughput test. Example output:
[ ID] Interval Transfer Bitrate
[ 4] 0.00-10.00 sec 1.10 GBytes 942 Mbits/sec
For more detailed testing, you can:
Use
-t
to specify test duration in secondsUse
-P
to run multiple parallel streamsUse
-R
to test in reverse direction
Setting a MAC Address
The phyBOARD-Lyra AM62x comes with randomly generated MAC addresses by default. While this ensures unique addresses for development, you may want to set static MAC addresses for production use. To learn how to configure static MAC addresses for your device, see MAC Address