I have an RPi zero which I want to use as 'co-processor' for my ZyXEL P2812HNU-F1 (lantiq xrx200). I installed the ethernet gadget on the zero, and when connecting to my laptop it works fine. (Mageia, kernel 4.14.70).
Connecting it to my router doesn't work. The relevant dmesg lines:
[ 13.290772] usb 1-1: new high-speed USB device number 2 using dwc2
[ 13.545694] cdc_ether 1-1:1.0 usb0: register 'cdc_ether' at usb-1e101000.ifxhcd-1, CDC Ethernet Device, 3e:71:5e:58:32:27
[ 22.216116] cdc_ether 1-1:1.0 usb0: kevent 11 may have been dropped
[ 22.221289] cdc_ether 1-1:1.0 usb0: kevent 12 may have been dropped
I get an usb0 device, and can assign an ip. When I try to ping it, I see this in tcpdump:
root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# tcpdump -i usb0
[ 950.885524] device usb0 entered promiscuous mode
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on usb0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:48:32.563460 ARP, Request who-has 192.168.0.10 tell 192.168.0.254, length 28
09:48:32.564011 00:00:00:00:00:00 (oui Ethernet) > 00:00:00:00:00:00 (oui Ethernet) Null Information, send seq 0, rcv seq 0, Flags [Command], length 28
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 ............
09:48:33.588781 ARP, Request who-has 192.168.0.10 tell 192.168.0.254, length 28
09:48:33.589207 00:00:00:00:00:00 (oui Ethernet) > 00:00:00:00:00:00 (oui Ethernet) Null Information, send seq 0, rcv seq 0, Flags [Command], length 28
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 ............
09:48:34.612795 ARP, Request who-has 192.168.0.10 tell 192.168.0.254, length 28
09:48:34.613294 00:00:00:00:00:00 (oui Ethernet) > 00:00:00:00:00:00 (oui Ethernet) Null Information, send seq 0, rcv seq 0, Flags [Command], length 28
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 ............
09:48:36.566273 ARP, Request who-has 192.168.0.10 tell 192.168.0.254, length 28
09:48:36.566659 00:00:00:00:00:00 (oui Ethernet) > 00:00:00:00:00:00 (oui Ethernet) Null Information, send seq 0, rcv seq 0, Flags [Command], length 28
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 ............
When I quit tcpdump, the router reboots:
30 packets capture[ 991.448665] device usb0 left promiscuous mode
d
30 packets received by filter
0 packets dropped by kernel
root@OpenWrt:/etc/config# [ 1045.939467] Data bus error, epc == 80205174, ra == 875e3048
[ 1045.943597] Oops[#1]:
[ 1045.945850] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.120 #0
[ 1045.951857] task: 80529da0 task.stack: 8051a000
[ 1045.956385] $ 0 : 00000000 80680000 9f9ba8a4 fff0ffff
[ 1045.961596] $ 4 : 9f9ba8c4 86af5820 000005ca 00000002
[ 1045.966820] $ 8 : ea2eef48 c0a8000a 10c0f6a7 08060001
[ 1045.972040] $12 : 08000604 7fb758cc 00000000 0002669b
[ 1045.977265] $16 : 87354c00 00000200 86af5800 000005ea
[ 1045.982485] $20 : 80571200 00010000 00000002 00000000
[ 1045.987711] $24 : 0000000a 875e3088
[ 1045.992930] $28 : 8051a000 87c0dea0 00000100 875e3048
[ 1045.998155] Hi : 00000016
[ 1046.001028] Lo : 00000001
[ 1046.003908] epc : 80205174 0x80205174
ROM VER: 1.0.5
CFG 06
NAND
NAND Read OK
Or actually it doesn't reboot:
Hit any key to stop autoboot: 2 1 0
NAND read: device 0 offset 0x60000, size 0x200000
NAND read from offset 60000 failed -74
0 bytes read: ERROR
Wrong Image Format for bootm command
ERROR: can't get kernel image!
This can be related to dsl. The box won't reboot if the dsl is in certain state. I never looked at the serial log, when that happened.
The router runs OpenWrt 18.06.1, kernel 4.9.120.
Any suggestions?
BTW, maybe related, I first tried to install OpenWrt on the zero, in combination with g_ether. But it didn't work. The usb device gave errors, and was not recognized. Sorry, didn't save a log. Using Raspbian it worked (with my laptop)