SAMA5D3 USB Ethernet Gadget

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

jeffkize
Posts: 4
Joined: Tue Jun 02, 2020 6:43 pm

SAMA5D3 USB Ethernet Gadget

Tue Jun 02, 2020 7:21 pm

We have an custom design based on the SAMA5D3_xplained reference design. I have an old (fido-based) build in which Gadget Ethernet works. I am attempting to update the build to the latest (tried warrior also) dunfell build. In my kernel config, I enable the RNDIS Ethernet Gadget along with the multifunction gadget interface. When I boot the system, Windows 10 loads the RNDIS Ethernet Gadget driver and configures the network interface. On the device, I see:

Code: Select all

[    4.900000] atmel_usba_udc 500000.gadget: MMIO registers at [mem 0xf8030000-0xf8033fff] mapped at 0aed0009
[    4.910000] atmel_usba_udc 500000.gadget: FIFO at [mem 0x00500000-0x005fffff] mapped at dd987e61
[    6.170000] using random self ethernet address
[    6.170000] using random host ethernet address
[    6.170000] usb0: HOST MAC 6a:98:1a:84:32:9b
[    6.180000] usb0: MAC 32:48:67:29:7a:1a
[    6.180000] using random self ethernet address
[    6.180000] using random host ethernet address
[    6.190000] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    6.190000] g_ether gadget: g_ether ready
[    6.470000] g_ether gadget: full-speed config #2: RNDIS

Code: Select all

root@sama5d3-pgrlsim:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3244 (3.1 KiB)  TX bytes:3244 (3.1 KiB)

usb0      Link encap:Ethernet  HWaddr 32:48:67:29:7a:1a
          inet addr:192.168.7.2  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::3048:67ff:fe29:7a1a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2419 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14514 (14.1 KiB)  TX bytes:780 (780.0 B)
However, when I try to ping, I get:

Code: Select all

root@sama5d3-pgrlsim:~# ping 192.168.7.1
PING 192.168.7.1 (192.168.7.1) 56(84) bytes of data.
From 192.168.7.2 icmp_seq=1 Destination Host Unreachable
From 192.168.7.2 icmp_seq=2 Destination Host Unreachable
From 192.168.7.2 icmp_seq=3 Destination Host Unreachable
From 192.168.7.2 icmp_seq=4 Destination Host Unreachable
From 192.168.7.2 icmp_seq=5 Destination Host Unreachable
From 192.168.7.2 icmp_seq=6 Destination Host Unreachable
This happens on both sides. Using tcpdump, I see the packets make it from Windows to the device, but nothing is sent back.

Any ideas?

Regards,
Jeff
blue_z
Location: USA
Posts: 2094
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D3 USB Ethernet Gadget

Wed Jun 03, 2020 2:52 am

Try the arping command instead of ping.

Regards
jeffkize
Posts: 4
Joined: Tue Jun 02, 2020 6:43 pm

Re: SAMA5D3 USB Ethernet Gadget

Thu Jun 04, 2020 10:09 pm

Running tcpdump in the background and running arping from the board to the PC, I get nothing:

root@sama5d3-xplained:~# arping 192.168.7.1
ARPING 192.168.7.1 from 192.168.7.14 usb0

If I ping the board from the PC, I get:
ifconfig usb0 192.168.7.3
tcpdump -i usb0 -xx -vv &

19:51:30.641274 [|ARP]
0x0000: ffff ffff ffff ea1a aa9c 2b1e 0806 0001
0x0010: 0800 0604
19:51:31.348378 [|ARP]
0x0000: ffff ffff ffff ea1a aa9c 2b1e 0806 0001
0x0010: 0800 0604
19:51:32.348213 [|ARP]
0x0000: ffff ffff ffff ea1a aa9c 2b1e 0806 0001
0x0010: 0800 0604


There is not response from the board. ifconfig shows a lot of RX with little TX:
usb0 Link encap:Ethernet HWaddr 16:63:ec:9d:c9:75
inet addr:192.168.7.3 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::1463:ecff:fe9d:c975/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1012 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6072 (5.9 KiB) TX bytes:780 (780.0 B)


This is running the atmel-demo-image
jeffkize
Posts: 4
Joined: Tue Jun 02, 2020 6:43 pm

Re: SAMA5D3 USB Ethernet Gadget

Tue Jun 09, 2020 9:56 pm

More information: we bought the SAMA5D3_XPLAINED board, programmed it with the same load, and it worked.

When we load the g_ether driver, it comes up in high-speed mode. On our custom board, it comes up in full-speed mode. We have a USB hub chip on our board. I put an external "USB 2.0" hub between the xplained board and the PC, and it can up in full-speed mode and didn't work.

I found another "USB 2.0" external hub, and with this one, the xplained board came up in high-speed mode and worked.

So does the Ethernet gadget have to be high-speed? or is there some config that can be done to allow it to work in full-speed mode?

Regards,
Jeff
jeffkize
Posts: 4
Joined: Tue Jun 02, 2020 6:43 pm

Re: SAMA5D3 USB Ethernet Gadget

Thu Jun 25, 2020 6:16 pm

Look into the different releases:

krogoth (Linux 4.4) works.
morty (Linux 4.9) fails.

Regards,
Jeff

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 6 guests