STM32 MPU Family - MCU Support Tips and Tricks - Point-to-Point Ethernet Ubuntu 16.04 Set-up |
Principle
In case you do not have access to a managed LAN offering DHCP server, it is possible to use an Ethernet point-to-point connection.
This can be physically implemented:
Target Network Set-Up
Using Console to the target, first check that eth0 network interface has been detected:
root@stm32mp1:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:80:E1:42:4E:0B
inet6 addr: fe80::280:e1ff:fe42:4e0b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:39 errors:0 dropped:0 overruns:0 frame:0
TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2530 (2.4 KiB) TX bytes:4803 (4.6 KiB)
Interrupt:60 Base address:0x8000
root@stm32mp1:~#
The proposal is to use private IP addresses on a dedicated sub-network : 192.168.8.x.
The adopted convention is the same as for Ethernet-over-USB:
It is recommended to configure systemd with a new file: 20-wired.network here, to have a boot persistent set-up.
root@stm32mp1:~# more /etc/systemd/network/20-wired.network
[Match]
Name=eth0
[Network]
Address=192.168.8.2/24
Gateway=192.168.8.254
root@stm32mp1:~#
On the next reboot of the target you should have the eth0 network interface configured.
root@stm32mp1:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:80:E1:42:4E:0B
inet addr:192.168.8.2 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::280:e1ff:fe42:4e0b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:190 errors:0 dropped:118 overruns:0 frame:0
TX packets:147 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16559 (16.1 KiB) TX bytes:14858 (14.5 KiB)
Interrupt:60 Base address:0x8000
root@stm32mp1:~#
PC Network Set-up
On Ubuntu 16.04 the top left icon allow to configure the network via Edit Connections... menu.
The interface is configured in Manual method with address 192.168.8.1 and netmask 255.255.255.0.
The connection is ready now !
The target is reachable with 192.168.8.2 IP address.