Typical USB Applications

There are many reasons for adding USB connectivity to an embedded system. These are some of the more popular applications.

Mass storage

Interfacing to removable USB memory sticks is the most popular embedded application for USB. This requires adding USB host capability to the embedded system so a USB memory stick (USB device) can be enumerated. It also requires a PC-compatible FAT file system (such as RTXCusb) to be integrated with the mass storage class driver.

Another use of the mass storage class is to set up the embedded system as a USB device so it can plug into a PC/laptop and be enumerated as a remote drive. After enumeration the resident memory on the embedded system could be read (or written to) by the PC.

Serial I/O

With RS-232 connectors disappearing from laptops, many system manufactures are looking to USB to provide a serial connection between a laptop or PC and the embedded system. You want a technician to be able to read log files and perhaps do a firmware update.

In this scenario, the PC is the USB host. The embedded system is the USB device. When the device is enumerated by the host, the host (PC) opens a communications port. This scenario employs a sub-class of the Communications Device Class – CDC Serial Emulation.

HID

The Human Interface Device class allows the attachment of USB devices such as a keyboard and/or mouse.

Printer

The Printer Class allows the Embedded Host to communicate to a printer over a USB connection.

Ethernet and Wireless

A sub-class of the Communications Device Class allows TCP/IP packets to be sent over USB. This is the USB class you would likely use to communicate to a Wi-Fi dongle.

Design Notes

Connect a USB Memory Stick

You want to be able to attach a USB flash memory device to your existing embedded system to upload files to a PC. This is a common embedded application for USB technology. Your embedded system needs to function as a USB host. The memory stick is a USB device (function or peripheral).

Software you will need to add to your embedded system:

  • RTXCusb Host Stack
  • RTXCusb Host Mass Storage Class Driver (allows the USB host to recognize and write to a memory device)
  • RTXCfatfile FAT file system (allows you to write files that are compatible with a PC)
  • Real-time operating system (the RTXC Quadros RTOS – already integrated with the above or your real-time operating system)

Hardware will you need to add or have available

  • USB host controller
  • USB type A connector
Embedded USB support for removable memory
Connect your Embedded System to a PC via USB

You want to be able to attach your embedded system to a PC so that a technician can read log files and perhaps do a firmware update.

In this scenario, the PC is the USB host. The embedded system is the USB device.

Software you will need to add to your embedded system:

  1. RTXCfatfile FAT32 file system (allows you to write files that are compatible with a PC)
  2. RTXCftl File Translation Layer (allows a NAND device to be addressed as a set of standard 512 byte logical sectors so that a FAT32 file system can write to resident flash. The Flash translation layer also provides wear leveling and protection against data loss from power failure)
  3. Real-time operating system (RTXC Quadros RTOS)
  4. RTXCusb Device Stack

Hardware will you need to add or have available

  • USB host controller
  • USB type A connector

NOTE: This implementation does not allow concurrent access to the resident Flash. The PC host and the embedded device will each need to reinitialize the file system before reading/writing to the Flash memory, and the embedded system needs to know not to attempt to write to the NAND flash while the PC is attached.

Embedded USB to PC connection