ECPi USB
Your computer can talk to the Raspberry Pi Zero over USB using either a serial tty connection, or an ethernet connection. The later supports file transfers.
This requires editing /media/dell/bootfs/config.txt abd /media/dell/bootfs/cmdline.txt.
Add the following last line to config.txt
dtoverlay=dwc2
Claude.ai says this does the following:
The Pi Zero's USB port is wired to a chip called the DWC2 (DesignWare USB 2.0 OTG controller). "OTG" means On-The-Go — the port can act as either:
- a USB host (like a normal PC USB port, so you can plug in a keyboard/mouse/flash drive), or
- a USB device/peripheral (so the Pi itself appears as a USB device when plugged into another computer — a flash drive, a network adapter, a serial modem, etc.)
By default, the Pi's firmware treats that port as a host. The dtoverlay=dwc2 line loads a device tree overlay — a small chunk of hardware description that tells Linux "hey, configure the DWC2 controller to run in USB peripheral/gadget mode instead."
Once that's active, Linux's USB gadget subsystem can bind different "personalities" to that port — a network card (g_ether), a serial port (g_serial), a mass storage device (g_mass_storage), etc. dtoverlay=dwc2 just switches the controller into the mode where gadget drivers can attach; it doesn't pick which gadget by itself — that's what the modules-load=dwc2,g_serial part in cmdline.txt does.
So the division of labor is:
config.txt → tells the hardware/firmware to put the USB controller in peripheral mode cmdline.txt → tells the kernel to load the specific gadget driver (serial, in your case) on top of it
cmdline.txt — this is one single line, no newlines. Find rootwait and insert right after it:
modules-load=dwc2,g_serial
So a stock line like:
console=serial0,115200 console=tty1 root=PARTUUID=xxxxxxxx-02 rootfstype=ext4 fsck.repair=yes rootwait
becomes:
console=serial0,115200 console=tty1 root=PARTUUID=xxxxxxxx-02 rootfstype=ext4 fsck.repair=yes rootwait modules-load=dwc2,g_serial
In the future how to connect ethernet over usb will be documented.
Built with the Forest WIki.
User contributed content is licensed under a
Creative Commons CC By 4.0 License.