🛠 Configurer le réseau Ethernet (via USB 2.0) d'un CM3+
Objectives
The CM3+ does not have an Ethernet controller on the module: on the CMIO3, the RJ45 port is driven by a USB chip (LAN9514 on the CMIO3) connected to the module's single USB 2.0 host/OTG port. An architectural consequence to understand clearly: Ethernet, USB drives, webcams, and adapters share the bandwidth of a single USB 2.0 bus (~30 MiB/s effective). This tutorial configures a robust static IP with systemd-networkd and measures the actual throughput.
Hardware
- CM3+ on CMIO3 (embedded Ethernet) or a custom board with a USB Ethernet chip
- Ethernet cable to a switch, iperf3 server on a PC on the network
- For a custom design without a USB chip: Ethernet does not exist natively on the SODIMM (nor PCIe), only the USB path is possible
Complete code
# 1. Identifier la puce réseau (USB, pas un contrôleur natif)
lsusb
ethtool -s eth0 speed 100 duplex full # si besoin, épingler 100M
# 2. IP statique avec systemd-networkd
sudo tee /etc/systemd/network/08-eth0.network <<'EOF'
[Match]
Name=eth0
[Network]
Address=192.168.1.50/24
Gateway=192.168.1.1
DNS=1.1.1.1
EOF
sudo systemctl disable --now NetworkManager 2>/dev/null
sudo systemctl enable --now systemd-networkd systemd-resolved
sudo systemctl restart systemd-networkd
# 3. Vérification et débit réel sur le bus USB unique
ip -4 addr show eth0 && ping -c3 192.168.1.1
sudo apt install -y iperf3
iperf3 -c 192.168.1.10 # côté PC : iperf3 -s
dmesg | grep -iE 'lan95|smsc' # trace de la puce USB-Ethernet
Expected verification
ip addr shows the static IP on eth0, ping works, and iperf3 displays a TCP throughput of around 20-30 MiB/s — the ceiling of the shared USB 2.0 bus, below the port's theoretical 100 Mbit/s. lsusb lists the Ethernet chip, proving it is a USB device and not a native controller.
Common errors
- Expecting gigabit: the CM3+ only knows 100M Ethernet via a USB chip; gigabit only arrives with the CM4 (via PCIe) — the entire CM3+ line is capped at USB 2.0.
- Combining a USB webcam + network transfer: the single bus is shared, images stutter as soon as the network saturates — isolate on a second module or reduce the resolution.
- NetworkManager / systemd-networkd conflict: both active managers interfere with each other; disable one of them properly.
- Forgetting
systemctl restart systemd-networkdafter editing the .network file: the IP does not change and one thinks it is a regression. - On a custom board, wiring an RMII PHY "like on a Pi 3": the CM3+ SODIMM does not expose a native Ethernet interface, only USB 2.0 — the USB-Ethernet chip is mandatory.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash