Enabling USB ethernet in NCM mode for iMX8M-Plus on a Dahlia Board

Hi,

Now I’m evaluating iMX8M-Plus with Dahlia Board (v1.1A) for one of our new projects. I want to measure the performance of USB ethernet gadget to see if USB 3.0 benefits on the module.

Currently I’m on tdx-reference-minimal-image with RT patch:
uname -a
Linux verdin-imx8mp-06848948 5.4.129-rt61-5.4.0-devel+git.cca85a46277d #1 SMP PREEMPT_RT Wed Aug 11 11:58:56 UTC 2021 aarch64 GNU/Linux

What is the most practical way of testing USB 3.0 for ethernet gadget on the board? I need X3 connector on the Dahlia board to test which is directly interfaced by Verdin SOM. Other USB port is connected to a Microchip USB HUB which will slow down the performance I assume.

Thanks.

Some update:

I have noticed that tdx-reference-minimal-image doesn’t include usb ethernet gadget available in: ./layers/meta-toradex-bsp-common/recipes-support/libusbgx/files/g1.schema.in

I modified tdx-reference-minimal-image.bb file and added packagegroup-tdx-cli into IMAGE_INSTALL. Now g1.schema file and related services are installed. Default schema file came with toradex-bsp configured to enable RNDIS instead of NCM that I need.

I modified g1.schema file to be as below (which I assume it enables USB 3.1 and NCM):

attrs :
{
    bcdUSB = 0x0310;
    bDeviceClass = 0x2;
    bDeviceSubClass = 0xd;
    bDeviceProtocol = 0x0;
    bMaxPacketSize0 = 0x40;
    idVendor = 0x1928;
    idProduct = 0x1e00;
    bcdDevice = 0x100;
};
strings = (
    {
        lang = 0x409;
        manufacturer = "Toradex";
        product = "Verdin iMX8M Plus";
        serialnumber = "11223344";
    } );
functions :
{
    ncm_usb0 :
    {
        instance = "usb0";
        type = "ncm";
        attrs :
        {
            # Random mac address
            qmult = 5;
        };
    };
};
configs = (
    {
        id = 1;
        name = "c";
        attrs :
        {
            bmAttributes = 0x80;
            bMaxPower = 0x2;
        };
        strings = (
            {
                lang = 0x409;
                configuration = "USB NCM config";
            } );
        functions = (
            {
                name = "ncm.usb0";
                function = "ncm_usb0";
            } );
    } );

With above settings Windows 10 recognized the device but without NCM driver. In the windows device manager, I right click to the Toradex device, click update driver → and installed Microsoft UsbNcm Host Device as shown here: https://docs.microsoft.com/en-us/answers/storage/attachments/91824-win10-native-ncm.pdf

The driver worked and it took the IP 192.168.11.2 from the verdin device. And the device itself is 192.168.11.1

Here is the iperf3 result reports about 360Mbps. I was expecting to get more than gigabit since USB 3.1 has 5Gbps clock.

root@verdin-imx8mp-06848948:~# iperf3 -c 192.168.11.2
Connecting to host 192.168.11.2, port 5201
[  5] local 192.168.11.1 port 55442 connected to 192.168.11.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  43.9 MBytes   368 Mbits/sec    0    222 KBytes
[  5]   1.00-2.00   sec  42.7 MBytes   358 Mbits/sec    1    222 KBytes
[  5]   2.00-3.00   sec  43.3 MBytes   363 Mbits/sec    1    157 KBytes
[  5]   3.00-4.00   sec  43.2 MBytes   362 Mbits/sec    0    210 KBytes
[  5]   4.00-5.00   sec  43.2 MBytes   362 Mbits/sec    0    210 KBytes
[  5]   5.00-6.00   sec  43.2 MBytes   362 Mbits/sec    0    210 KBytes
[  5]   6.00-7.00   sec  43.1 MBytes   362 Mbits/sec    0    210 KBytes
[  5]   7.00-8.00   sec  43.1 MBytes   361 Mbits/sec    0    210 KBytes
[  5]   8.00-9.00   sec  43.3 MBytes   363 Mbits/sec    0    210 KBytes
[  5]   9.00-10.00  sec  43.2 MBytes   362 Mbits/sec    0    210 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   432 MBytes   362 Mbits/sec    2             sender
[  5]   0.00-10.00  sec   431 MBytes   362 Mbits/sec                  receiver

iperf Done.

Do you know that if this speed is expected or I do something wrong?

Thank you.

Hi @Fide !

We are currently trying to reproduce the behavior on our side.

I’ll get back to you when we get some results.

Best regards,

1 Like

Hi @henrique.tx,

Is there any update on your side? We really need to measure the performance of USB3.1 ethernet gadget.

Today I noticed that X3 USB-C connector on Dahlia Carrier board v1.1 doesn’t have super speed pins connected:

We have also Verdin Development Board, it looks like same there.

I wonder why? It is supported by the Verdin iMX8M Plus SoM right? Is there an alternative carrier board that we can test USB 3.1 Ethernet gadget?

Thank you.

Hi @Fide

Taking a look at the module’s datasheet and family specification (Verdin iMX8M Plus | Toradex Developer Center), we can see that:

  • USB_1 interface (exposed by the USB type-C connector X3) is not SuperSpeed capable.
  • USB_2 interface (exposed by the USB type-A connector X4) is SuperSpeed capable.

So, if I understood correctly, as the USB gadget on the module would be seen as a device to, let’s say, the computer that it will be connected to, having the SuperSpeed at the USB type-A isn’t suitable for you.

To use this interface as a gadget, you would need to design your own carrier-board. Or maybe, if possible, keep using Dahlia, but with a limited transfer rate.

Best regards,

Hi @henrique.tx ,

USB_2 interface (X4) supports superspeed connected internally to Microchip USB5744T USB Hub on the Dahlia Board. Can it be used as an ethernet gadget?

Thank you.

Hi @Fide!

The X4 is a type-A (host role), so it should only be connected with USB devices.

If you are going to connect the module (as a USB host) to another thing that will act as a USB device, then it is good.

On the other hand, you shouldn’t connect the X4 to, e.g. your computer’s USB type-A connector, as both will be USB hosts.

Best regards,