STM32 MPU Family - MCU Support Tips and Tricks - Ethernet-over-USB VMware Settings |
We discuss hereafter a VMware software installed onto a Windows PC and running a Ubuntu 16.04 Virtual Machine, the Linux VM.
The purpose is to establish a network connection in between this Linux VM and the Linux running onto the MPU target via the dedicated USB cable.
This is a point to point connection.
Driver installation
Using Console to the target, first check that usb0 network interface is UP:
root@stm32mp1:~# ifconfig usb0
usb0 Link encap:Ethernet HWaddr 32:2A:2F:8F:9C:A8
inet addr:192.168.7.2 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::302a:2fff:fe8f:9ca8%3200150032/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1751 errors:0 dropped:30 overruns:0 frame:0
TX packets:759 errors:0 dropped:2 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:159931 (156.1 KiB) TX bytes:218433 (213.3 KiB)
Then, check that dedicated USB OTG cable is connected to the target.
On the Windows PC, the control of the USB Gadget corresponding to this point-to-point network connection is given to the Linux Virtual Machine.
It is then visible using an lsusb command:
stm32bv@gnbcxd0102: lsusb
Bus 002 Device 002: ID 8087:8002 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:800a Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 0451:8140 Texas Instruments, Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 087: ID 0483:3752 STMicroelectronics
Bus 003 Device 003: ID 03f0:094a Hewlett-Packard Optical Mouse [672662-001]
Bus 003 Device 002: ID 03f0:034a Hewlett-Packard Elite Keyboard
Bus 003 Device 040: ID 0483:3752 STMicroelectronics
Bus 003 Device 004: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 003 Device 088: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
stm32bv@gnbcxd0102:
Network Interface Set-up
On Ubuntu 16.04 the corresponding network interface appears then, it is name in our case ens35u1.
By default, DHCP address search is triggered and represented on the Windows Manager by the top left "searching icon".
As a first proposal, click on top left icon and then choose "Wired connection 2" for a Disconnect.
A Pop-up "Disconnected" should appear, before the vertical arrows icon meaning the network is functional.
stm32bv@gnbcxd0102: sudo ifconfig ens35u1 192.168.7.1 netmask 255.255.255.0
stm32bv@gnbcxd0102: sudo ifconfig ens35u1 up
ens35u1 Link encap:Ethernet HWaddr 4a:83:81:8b:a1:3b
inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::4883:81ff:fe8b:a13b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Note that the name of the network interface ens35u1 may differ.
The connection is ready now !
The target is reachable with 192.168.7.2 IP address.
NB: In case of connection lost in VMware, you can relaunch the sudo ifconfig commands in order to reassign the IP address.