USB Host Ethernet Driver

That’s probably the issue, I only have it setup to work with the AX88772B chipset, likely my driver is trying to claim it since I’m only testing for the manufacturer and not the specific device, but each chipset has to be setup a little bit differently. I would have to look through the Linux driver to get some of the specifics and rearrange some stuff in my driver to better support different chipsets.
 
Ok.. was a bad buy, then.
I've enabled the USB logging on the t4. It says:
Code:
USB Host InputFunctions example

USB2 PLL running

 reset waited 6

USBHS_ASYNCLISTADDR = 0

USBHS_PERIODICLISTBASE = 20016000

periodictable = 20016000

USB Ready

port change: 10001803

    connect

  begin reset

port change: 18001205

  port enabled

  end recovery

new_Device: 480 Mbit/sec

new_Pipe

enumeration:

enumeration:

enumeration:

Device Descriptor:

  12 01 00 02 FF FF 00 40 95 0B 20 77 01 00 01 02 03 01 

    VendorID = 0B95, ProductID = 7720, Version = 0001

    Class/Subclass/Protocol = 255 / 255 / 0

    Number of Configurations = 1

enumeration:

enumeration:

Manufacturer: ASIX Elec. Corp.

enumeration:

Product: AX88772A

enumeration:

Serial Number: 000544

enumeration:

Config data length = 39

enumeration:

Configuration Descriptor:

  09 02 27 00 01 01 04 A0 7D 

    NumInterfaces = 1

    ConfigurationValue = 1

  09 04 00 00 03 FF FF 00 07 

    Interface = 0

    Number of endpoints = 3

    Class/Subclass/Protocol = 255 / 255 / 0

  07 05 81 03 08 00 0B 

    Endpoint = 1 IN

    Type = Interrupt

    Max Size = 8

    Polling Interval = 11

  07 05 82 02 00 02 00 

    Endpoint = 2 IN

    Type = Bulk

    Max Size = 512

    Polling Interval = 0

  07 05 03 02 00 02 00 

    Endpoint = 3 OUT

    Type = Bulk

    Max Size = 512

    Polling Interval = 0

enumeration:

Descriptor 4 = INTERFACE

ASIXEthernet claim this=200025A0

type=1

vid=B95, pid=7720, bDeviceClass = 255, bDeviceSubClass = 255, bDeviceProtocol = 0

numEndpoints=3

      interrupt_size = 8

      interrupt_ep = 129

      interrupt_interval = 11

      rx_size = 512

      rx_ep = 130

      rx_interval = 0

      tx_size = 512

      tx_ep = 3

      tx_interval = 0

new_Pipe

new_Pipe

new_Pipe

allocate_interrupt_pipe_bandwidth

  ep interval = 11

  interval = 256

 best_bandwidth = 3, at offset = 0

Control - ASIX...

Descriptor 5 = ENDPOINT

Descriptor 5 = ENDPOINT

Descriptor 5 = ENDPOINT

control callback (asix) 1

Done

control callback (asix) 2

Done

control callback (asix) 3

nodeID: 00 0E C6 59 FB D5 

control callback (asix) 4

Done

control callback (asix) 5

Done

control callback (asix) 6

Done

control callback (asix) 7

Done

Manufacturer: ASIX Elec. Corp.
Product: AX88772A

so, it is chip revision A
 
Hopefully there is a simple fix? I got two of the same from Amazon - USBDeview:
ASIX_ethernetUSB.png

Amazon 'Basics' USB 2.0 version

And another exe - USBView.exe:
Code:
Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0xFF
bDeviceSubClass:      0xFF
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:           0x0B95 (ASIX Electronics Corp.)
idProduct:          0x772B
bcdDevice:          0x0001
iManufacturer:        0x01
0x0409: "ASIX Elec. Corp."
iProduct:             0x02
0x0409: "AX88772B"
iSerialNumber:        0x03
0x0409: "E225AB"
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     High
Device Address:       0x2E
Open Pipes:              3

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x0B

Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0200 (512)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x03  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0200 (512)
bInterval:            0x00

Configuration Descriptor:
wTotalLength:       0x0027
bNumInterfaces:       0x01
bConfigurationValue:  0x01
iConfiguration:       0x04
0x0409: "0"
bmAttributes:         0xA0 (Bus Powered Remote Wakeup)
MaxPower:             0x64 (200 Ma)

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x03
bInterfaceClass:      0xFF
bInterfaceSubClass:   0xFF
bInterfaceProtocol:   0x00
iInterface:           0x07
0x0409: "0"

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x0B

Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0200 (512)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x03  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0200 (512)
bInterval:            0x00
 
It still works for me. Amazon USB ether dongle hooked to T4B2 USB host port. Ethernet hooked to switch -> router/switch
dongle's yellow and green LED are ON. Built/ran example ASIXEthernet_Test sketch which says:
Code:
USB Host InputFunctions example
USB Ready
Mutex initialized: 0
Mutex initialized: 1
TCP/IP stack initialization is done.

SetMACAddress: 0050B6BE8BB4
MulticastJoin: 333300000001
MulticastTable: 
0
0
10000000
0
0
0
0
0
MulticastJoin: 3333FFBEAAE2
MulticastTable: 
0
1
10000000
0
0
0
0
0
netif Initialized
Initializing DHCP
DHCP initialization done!
IPAddress: 0.0.0.0
SubnetMask: 0.0.0.0
Gateway: 0.0.0.0
DHCPServer: 0.0.0.0
State: 2


IPAddress: 192.168.1.132
SubnetMask: 255.255.255.0
Gateway: 192.168.1.1
DHCPServer: 192.168.1.1
State: 5
MAC address matches sticker on dongle.

T4 is listening for TCP on port 7007, on my linux box I do
Code:
ttcp -t -s -p 7007 192.168.1.132
ttcp-t: buflen=8192, nbuf=2048, align=16384/0, port=7007  tcp  -> 192.168.1.132
ttcp-t: socket
ttcp-t: connect
ttcp-t: 16777216 bytes in 5.95 real seconds = 2755.87 KB/sec +++
ttcp-t: 2048 I/O calls, msec/call = 2.97, calls/sec = 344.48
ttcp-t: 0.0user 0.0sys 0:05real 0% 0i+0d 740maxrss 0+2pf 280+0csw

and serial monitor reports
Megabytes: 16.777216  Seconds: 5.9730  KBits/Sec: 22470.7397

if i plug dongle into linux, lsusb says: Bus 001 Device 004: ID 0b95:772b ASIX Electronics Corp. AX88772B
 
Last edited:
Yes I had no luck with my buy.
None of these dongles have their exact chipset published. I just hoped it was okay - the description said AX88772<- no "B" or "A" - and i did not expect a real difference.
So, I just put it away and do other things. I try it again later, in a few weeks.
 
Yes I had no luck with my buy.
None of these dongles have their exact chipset published. I just hoped it was okay - the description said AX88772<- no "B" or "A" - and i did not expect a real difference.
So, I just put it away and do other things. I try it again later, in a few weeks.

Wondering if you got the USB2 or USB3? As linked above the 'Basics' version USB 2.0 has 'black' insert block in the USB connector - as pictured on the U.S. Amazon site. I ordered two at different times - and both arrived with the same compatible chipset on them. I wanted an extra for my Surface laptop with no built in Ethernet and it worked well there too.
 
so close … not choice but indeed 'basics' > https://www.amazon.de/dp/B00M77HLII

Ok, the Amazon Basics USB2.0 adapter works.
Code:
USB Host InputFunctions example

USB Ready

Mutex initialized: 0

Mutex initialized: 1

TCP/IP stack initialization is done.


SetMACAddress: 0050B6BE8BB4

MulticastJoin: 333300000001

MulticastJoin: 3333FFE776CB

netif Initialized

Initializing DHCP

DHCP initialization done!

IPAddress: 0.0.0.0

SubnetMask: 0.0.0.0

Gateway: 0.0.0.0

DHCPServer: 0.0.0.0

State: 2





DHCP Released

Mutex released

Mutex released

Mutex initialized: 0

Mutex initialized: 1

TCP/IP stack initialization is done.


SetMACAddress: 0050B6E776CB

MulticastJoin: 333300000001

netif Initialized

Initializing DHCP

DHCP initialization done!

IPAddress: 0.0.0.0

SubnetMask: 0.0.0.0

Gateway: 0.0.0.0

DHCPServer: 0.0.0.0

State: 2





IPAddress: 192.168.178.46

SubnetMask: 255.255.255.0

Gateway: 192.168.178.1

DHCPServer: 192.168.178.1

State: 5

Thanks :) Good work!
 
I haven’t done much work with it outside of TCP, this whole project was just because I needed faster TCP than I could get with a w5500 for a custom euphonix controller.
 
Do you have a simple http-request example ?

if you look in sketchbook/libraries/FNET/src/service, you'll see a collection of client/server folders:
Code:
autoip/  dns/			 fnet_service.h*      link/   serial/  tftp/
azure/	 flash/			 fnet_service_prv.h*  llmnr/  shell/   tls/
bench/	 fnet_service.c*	 fs/		      mdns/   sntp/
dhcp/	 fnet_service_config.h*  http/		      ping/   telnet/
You'll need to create a sketch that initializes various parameters and provides callbacks for your client/server of choice. you see there is an http/ folder that has both client and server code. Study the lib examples > ASIXEthernet_Test sketch. it uses the service/bench/ folder to create the simple benchmarks sketch that you can run against fbench.exe. I managed to use the sntp/ client to create an SNTP test sketch.
 
Ah, great, thank you.
Would you mind to post your SNTP sketch?

see attached tmp.zip. I had tried different things with this sketch (like not using threads), but i think this is a working version. you'll need to provide an IP for an NTP server
 

Attachments

  • tmp.zip
    5.1 KB · Views: 77
see attached tmp.zip. I had tried different things with this sketch (like not using threads), but i think this is a working version. you'll need to provide an IP for an NTP server

"tmp" is a nice name for that :) Thank You!!
But It does not work for me.. i updated the IP fo my ntp-server (my router) - but it happens nothing.
 
I just tried it on T3.6 and T4.0, works for me. Sketch prints the usual startup stuff for DHCP etc, then
Code:
...
ntp 3791047716 887142411 utc 20:48:36  RTT 896 us
ntp 3791047717 891406643 utc 20:48:37  RTT 893 us
ntp 3791047718 895724579 utc 20:48:38  RTT 890 us
...
It's not very robust, if reply never comes it never tries to send again (needs a retry timer?). Maybe sniff with wireshark and see if you see NTP packets on the wire. i have an NTP server running on one of my local linux boxes.

EDIT: ooops, I actually altered fnet_sntp.c in the FNET lib to capture RTT with micros(), so it's a bit of a hack.
Code:
diff fnet_sntp.c.0 fnet_sntp.c
256a257
> 	static uint32_t us;
263a265
> 			us = micros();
281a284
> 			us = micros()-us;
328a332
> 			if (sntp_if->callback_cookie) *(uint32_t *)(sntp_if->callback_cookie) = us;
 
Last edited:
Playing with the numbers for Udp 3000 messages of 32000 bytes in 1 fBench second?
0.990 96,000,000 775,465.875
1.038 96,000,000 739,825.806
1.019 96,000,000 753,759.301
1.011 96,000,000 760,004.148
0.999 96,000,000 769,068.005
1.000 96,000,000 768,217.790
I'm trying to make sense of these "unbelievably" fast UDP data rates. The amazon USB Ethernet dongle is only good for 10/100 mbs Ethernet? So what does 760 mbs mean? Even the USB is only 480 mbs? A 32768 byte UDP "message" will require IP fragmentation to break the message into MSS (1460)- byte packets. UDP data rates are best measured at the receiver.

In my tests (post #264), I measure about 95 mbs for UDP transmits (1000-byte UDP packets), rate measured at receiver, no drops.
 
FNET already handles separating messages into the correct max size, my guess is it’s exceeding the number of USB buffers that I have set without waiting for them to free up. I believe I put in something to stop that from happening though, can you verify that all messages are making it to the receiver? If all aren’t making it then somewhere they are being discarded before USB gets it so that would explain the speed discrepancy.
 
I'm trying to make sense of these "unbelievably" fast UDP data rates. The amazon USB Ethernet dongle is only good for 10/100 mbs Ethernet? So what does 760 mbs mean? Even the USB is only 480 mbs? A 32768 byte UDP "message" will require IP fragmentation to break the message into MSS (1460)- byte packets. UDP data rates are best measured at the receiver.

In my tests (post #264), I measure about 95 mbs for UDP transmits (1000-byte UDP packets), rate measured at receiver, no drops.

All the others had net throughput under 100K bits/sec. Have to find a table showing the column labels - it shows total bytes in test period - not sure of the others just now.

These are UDP, any chance some were not even received or processed on the Teensy end?

@manitou - looking at post#22 on some test thread:
View attachment 19185
TCP is where it should be - UDP is just flooding and counted as good?
 
If the UDP messages are being sent from fbench to the Teensy then the throughput can very well show 750 mbps if your computer is on a gigabit connection to your router since the connection speed of the Teensy would have little to no effect for UDP messages wether they are being lost or not.
 
If the UDP messages are being sent from fbench to the Teensy then the throughput can very well show 750 mbps if your computer is on a gigabit connection to your router since the connection speed of the Teensy would have little to no effect for UDP messages wether they are being lost or not.

ah, that makes sense. I don't have GigE on my home setup.
 
Back
Top