Ethernet
Gigabit Ethernet links are provided via the ETH0 and ETH1 RJ45 connectors on the phyCORE-i.MX8X development kit. This guide shows you how to connect and use these interfaces.
Requirements
Establishing a Connection
Note
If a valid connection between the phyCORE-i.MX8X development kit and a DHCP enabled network is made before boot-up then the phyCORE-i.MX8X 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@imx8qxpmek:~# ping -c 10 google.com PING google.com (172.217.14.238) 56(84) bytes of data. 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=1 ttl=53 time=135 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=2 ttl=53 time=11.9 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=3 ttl=53 time=12.2 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=4 ttl=53 time=15.5 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=5 ttl=53 time=12.4 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=6 ttl=53 time=11.9 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=7 ttl=53 time=28.9 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=8 ttl=53 time=69.1 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=9 ttl=53 time=15.6 ms 64 bytes from sea30s02-in-f14.1e100.net (172.217.14.238): icmp_seq=10 ttl=53 time=15.6 ms --- google.com ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9009ms rtt min/avg/max/mdev = 11.909/32.853/135.067/37.935 ms
Finding the IPv4 Address
To view the IP address assigned to your device’s network interfaces, use the following command:
ifconfig
root@imx8x-phycore-kit:~# ifconfig eth0 Link encap:Ethernet HWaddr 86:95:e9:d3:aa:c3 inet addr:172.22.30.7 Bcast:172.22.30.255 Mask:255.255.255.0 inet6 addr: fe80::8495:e9ff:fed3:aac3/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:89 errors:0 dropped:16 overruns:0 frame:0 TX packets:62 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:27554 (26.9 KiB) TX bytes:11921 (11.6 KiB) eth1 Link encap:Ethernet HWaddr 3a:eb:67:9e:0b:89 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:86 errors:0 dropped:0 overruns:0 frame:0 TX packets:86 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7496 (7.3 KiB) TX bytes:7496 (7.3 KiB)
In the above example, we can see that ETH0 was assigned the IPv4 address 172.22.30.7
SSH into Kit
Once the phyCORE-i.MX8X’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-i.MX8X 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:
sudo apt-get update sudo apt-get install ssh
The phyCORE-i.MX8X 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 '172.22.30.7 (172.22.30.7)' can't be established. RSA key fingerprint is SHA256:KUCQauJS5i5gk11HVqU8/qenIr8XeYBaWC7Oks5TKAE. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.22.30.5' (RSA) to the list of known hosts. root@imx8x-phycore-kit:~#
Trouble Establishing an SSH Connection?
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-i.MX8X target.
A final place to troubleshoot network related issues between the phyCORE-i.MX8X 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.