USB Component  Version 6.15.0
MDK Middleware for USB Device and Host Communication
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
USB Device RNDIS to Ethernet Bridge

The USB Device RNDIS to Ethernet Bridge example connects a Windows host via USB to a Cortex-M system that provides an Ethernet interface for network connectivity.

The following picture shows an exemplary connection of the development board (in this case a MCB4300) to a host PC.

usb_dev_rndis_eth_bridge.png

The Abstract.txt file contained in the Documentation group of the Project window gives you more information on the general setup.

Build the "RNDIS to Ethernet Bridge" project

Open the example project in MDK. The ┬ÁVision Project window should display a similar project structure:

usb_dev_rndis_eth_bridge_proj_win.png
Typical project structure of the RNDIS bridge example

Source Files

  • main.c contains the main C function that initializes the Keil RTX real-time operating system.
  • RNDIS.c contains the app_main C function that initializes the GLCD and the USB Device Component.
  • The files USBD_User_CDC_ACM_RNDIS_ETH_0.c implements the application specific functionality of the CDC ACM class using the RNDIS protocol and is used to implement a Network Interface Card (NIC) to Ethernet Bridge to the USB Host. Refer to CDC: Communication Device Class (ACM) for details about these template functions.

If you are using RTOS other than CMSIS-RTOS2 RTX5 for your project please make sure to satisfy USB Device Resource Requirements.

You may now build and download the example project to the development board using the ┬ÁVision commands:

  • Project –> Build target (F7)
  • Flash –> Download (F8)

After these steps, the project should start executing on your development kit. In case of errors, refer to the development board user's guide for configuration information.

Using the "RNDIS to Ethernet Bridge" Project

Hardware Setup

The setup of the development board hardware is described in the Abstract.txt file.

  • Verify all jumper settings on the target hardware.
  • Power your development board externally.
  • Connect a USB cable between your development board and the host PC.
  • You should see new "Ethernet" connection with a "Remote NDIS compatible device" in your network control panel:
    usb_dev_rndis_eth_bridge_control_panel.png
    if driver is not installed automatically please install driver from example folder.

About Host PC driver for Microsoft Windows

The example folder contains two files relevant for driver installation on the Microsoft Windows:

  • Driver setup information file (xxx-rndis.inf) which is used to create a digitally signed driver catalog file (xxx-rndis.cat)
  • Digitally signed driver catalog file (xxx-rndis.cat)

The driver files are provided as an example, the driver setup information file should be adapted and digitally signed driver catalog file should be created from adapted driver setup information file.

Driver setup information file should be adapted in the following way:

  • c251 in Vendor ID VID_c251 entries should be changed to the vendor ID number assigned to your company by the USB organization (c251 Vendor ID is reserved for Keil Software and should not be used)
  • xxxx in Product ID PID_xxxx entries should be changed to the product ID as assigned by your company
  • in [DeviceList.xxx] sections, entries not relevant for the device, should be removed or added as described below:
    • if device is pure RNDIS CDC class device (not composite) then all entries ending with &MI_xx should be removed
    • if device is a composite device with one or more RNDIS CDC class instances then entries not ending with &MI_xx should be removed and entries ending with &MI_xx should exist for each RNDIS CDC class instance (example driver contains entries ending with &MI_00 and &MI_02 which are used for composite device containing two RNDIS CDC class instances and each instance uses 2 interfaces where MI_00 describes first RNDIS instance and MI_02 entry describes second RNDIS CDC instance)
  • [Strings] section should be changed as desired
Note
Vendor ID and Product ID are configured in the USBD_Config_n.c configuration file of the embedded application.
For producing digitally signed driver catalog file please refer to Microsoft Windows documentation.