Skip to end of metadata
Go to start of metadata

This example creates and opens a Micrium OS Network Ethernet interface that uses the CDC EEM USB device class as a transport layer.

This example will allow you to accomplish the following tasks:

  • Initialize the CDC EEM class
  • Create and register a CDC EEM class instance
  • Add the CDC EEM class instance to the Full-Speed configuration
  • Add the CDC EEM class instance to the High-Speed configuration (if available)
  • Add the new Ethernet Interface created from the CDC EEM class instance to Micrium OS Network
  • Start the Ethernet interface

Location

The example implementation is located in /examples/usb/device/all/ex_usbd_cdc_eem_net.c.

Running the Demo Application

Currently, only the Linux operating system has built-in support for CDC EEM devices. Note that some third-party commercial drivers can be found for Microsoft Windows and Apple macOS.

Once connected to a Linux host, the operating system will add a new network interface called "usbx" (where x is a number starting from 0). The command ifconfig can be used from a terminal prompt to see the different network interfaces available, and to set a static IP address to the "usbx" interface. This will be necessary if you don't have a DHCP server on your target.

Once done, you should be ready to perform ping commands from a terminal prompt and use any other application implemented on your device (HTTP, FTP, etc).

API

This example offers only one API named Ex_USBD_CDC_EEM_Init(). This function is normally called from a USB device core example.