cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device RNDIS Linux drivers

AlexSmart
Senior

Im struggling with USB Device RNDIS example . Works fine on Windows PC, but no network interface appears on Linux, it listed in lsusb output.

I cant find any topics related to that issue

1 ACCEPTED SOLUTION

Accepted Solutions

I mean that windows has the only host RNDIS class driver  support that can recognize RNDIS USB devices. 

You are right st usb middleware and cdc ecm device class run in standalone mode .

And azure rtos cdc ecm class run in rtos mode with threadx. 

 

View solution in original post

7 REPLIES 7
Mohamed_AYED
Associate III

Hi @AlexSmart 

RNDIS is a Microsoft proprietary protocol, as i know that rndis host is supported only with windows. for linux you can use the CDC-ECM class (Ethernet Control Model)

well its not host but device, and for CDC-ECM ok, I can try that, but sadly no CMSIS rtos compatible examples found. Maybe there is a way to push those drivers to linux?

I mean that windows has the only host RNDIS class driver  support that can recognize RNDIS USB devices. 

You are right st usb middleware and cdc ecm device class run in standalone mode .

And azure rtos cdc ecm class run in rtos mode with threadx. 

 

AlexSmart
Senior

Thank you!

kulichbulich
Associate

We had the same problem, USB-ECM works great under Linux and OSX, but it doesn't work under Windows (it can be solved with the driver, but the problem demo version which is free is works only for 30 minutes). Default STM32 RNDIS only worked under Windows and there was a problem with enumeration under Linux, but after debugging I came up with this modification and RNDIS now works under both Windows and Linux.

My problem was that Linux requires a command that is not implemented in the default implementation from ST. It is an RNDIS_MSG_QUERY command with a value of 0x01010101 (UX_DEVICE_CLASS_RNDIS_OID_802_3_PERMANENT_ADDRESS)

[ 5043.521350] usb 5-1.1.3: new high-speed USB device number 17 using xhci_hcd
[ 5043.663724] usb 5-1.1.3: New USB device found, idVendor=0483, idProduct=5742, bcdDevice= 2.00
[ 5043.663740] usb 5-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5043.663784] usb 5-1.1.3: Product: STM32 USB Device
[ 5043.663791] usb 5-1.1.3: Manufacturer: STMicroelectronics
[ 5043.663796] usb 5-1.1.3: SerialNumber: 000000000001
[ 5043.724852] rndis_host 5-1.1.3:1.0: RNDIS_MSG_QUERY(0x01010101) invalid response - off 16 len 4
[ 5043.724869] rndis_host 5-1.1.3:1.0: rndis get ethaddr, -33
[ 5043.725371] rndis_host: probe of 5-1.1.3:1.0 failed with error -33

 

Modification:

In file ux_device_class_rndis_msg_query.c

kulichbulich_0-1725276103775.png

In function _ux_device_class_rndis_msg_query before default (line 327) put this code:
 
 
        case UX_DEVICE_CLASS_RNDIS_OID_802_3_PERMANENT_ADDRESS            :
 
 
            /* Save the Hardware address in the return message.   */
            _ux_utility_memory_copy(rndis_response + UX_DEVICE_CLASS_RNDIS_CMPLT_QUERY_INFO_BUFFER,
                                    rndis -> ux_slave_class_rndis_local_node_id, UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH); /* Use case of memcpy is verified. */
 
            /* Set the total response length.  */
            rndis_response_length = UX_DEVICE_CLASS_RNDIS_NODE_ID_LENGTH;
 
            break;

 

Hi @kulichbulich

The Azure RTOS transition to open-source is now complete and the first release of ThreadX real-time operating system Eclipse ThreadX 6.4.1 now available under MIT license.   Learn more.

 

You can contribute directly in https://github.com/eclipse-threadx/usbx by creating a PR (pull request), this PR will be reviwed by project committer (ST USB Team included).

 

Hi @Mohamed_AYED

I wasn't able to create a pull-request (I'm not a contributor), so I created a bug report with a proposed solution.

https://github.com/eclipse-threadx/usbx/issues/171