User-agent: * Allow: /
Belcarra Technologies has been a leader in the evolution of USB and it’s use for connecting network peripherals of all types. As a pioneer in the provision of driver software both for smart peripherals as well as for the desktop operating systems that support them, Belcarra’s solutions enable devices to share data across the USB fabric as if they were connected to an otherwise normal TCP/IP network via Ethernet.

CDC-EEM for a microcontroller


A USB device presents various descriptors to the host in one or more configurations.  If the first configuration matches an\ driver information (INF) file on Windows, then a matching driver in Windows will be loaded. The driver will then examine additional descriptors from the device, and if it is satisfied, it will issue a Set Configuration request to the device, and the device will now be enumerated.

All of the major microcontrollers have libraries that implement the foregoing for simple cases.  To implement a custom protocol, such as CDC-EEM, you need to do the following

  • Modify the Device Descriptor to conform to the requirements of the protocol.  Specifically, you need to set the following values:
    • Class --0x2 = networking device
    • Subclass - 0xc
    • Protocol- 0x7
    • Vendor ID
    • Product ID
  • Modify the Configuration Descriptor and supplementary descriptors (interface, endpoint, string descriptors) to match
  • Modify your network subsystem transmit to fill EEM frames. Your code fills EEM buffers with one or more network frames, and when a buffer is deemed ready, start transmitting it
  • The USB OUT (receive) subsystem will receive 1 EEM frame in a USB transfer, consisting of 1 or more USB packets of maximum length (64 bytes for full speed, 512 bytes for high speed USB) followed by a short or ZLP (zero-length packet). We assume there already support for low-level USB operations.  In particular, at interrupt time we can be informed that a packet of data has been received.  If we are in the process of building an EEM frame, the a full-speed packet is copied to the frame. The EEM standard doesn’t say how big an EEM frame is but USBLAN provides a way for both sides to agree on the maximum size.
  • When an incoming EEM frame is complete, a loop should be triggered  that unpacks it into its component parts (1 or more Ethernet frames) which end become incoming frames to the network subsystem.
  • During the time that incoming EEM frame is being unpacked, new OUT (incoming) data needs to be directed to another buffer.  So the system needs at least two EEM frames in each direction, one to feed the network subsystem and the other to feed the USB subsystem.

The EEM Standard

The EEM Standard document not only specifies the frame formats and other technical data in the usual terse language of standards, but contains a number of explanatory appendices which give a lot of guidance on how to implement and use EEM.

Microchip PIC32 Networking over USB

Belcarra’s implementation of Networking over USB for the Microchip PIC32 is a very low cost networking solution for PIC32 projects, eliminating the need to add an Ethernet chip while using less Flash and RAM resources.

Full details and demonstration kit download available here.


Belcarra's TestDrive environment for USB Networking protocols has been revisited using TI's PandaBoards.

A full description: Installing and using TestDrive-Panda is available here.

USB TestDrive Network Scripts

The TestDrive scripts described here can be used to load the appropriate modules for all of the various network protocols and variants supported by USBLAN. In the case of RNDIS, it is also possible to tell Windows to use the built-in VID/PID values (therefore not using USBLAN). This allows USBLAN/native RNDIS comparison.

The scripts described here are the foundation: they load network protocols. After this has been done, various network tests can be run. These are described elsewhere.

Supported Protocols
The supported protocols are:
  • ECM
  • EEM
  • NCM
  • ECM subset
  • SAFE (another ECM subset)
All the protocols, can be loaded with the std (Gadget) implementation in the Linux kernel, or the btc (Belcarra) implementation. In particular Belcarra’s implementation of NCM and EEM is more advanced in important ways that are explained below.

Basic invocation modelThe scripts use a uniform invocation model as follows
stack-protocol [-q] VID PID [IP]

Popular Posts