FEATURE EMBEDDED TECHNOLOGY
KEY MESSAGES
Many embedded systems employ removable USB keys (flash drives) for data transfer, system configuration, firmware updates and/or user authentication purposes. Here Michael Barrett, managing director of Nexus Industrial Memory, explores some of the core design considerations
T
he USB specification governs that to read from or write to a USB flash
drive, a USB host is needed. It is a mix of hardware, software and ‘middleware’ plus a mechanical type A receptacle. In addition, there are several classes of USB device and a class code, embedded within the device, identifies its core functionality (e.g. mass storage, printer, audio etc.) to the host so that appropriate drivers can be loaded. Accordingly, as a designer, if you want your system to communicate with a USB device you must select and embed the appropriate device drivers, class drivers and protocol stacks. For instance, to support a USB flash drive, a USB host should include the components shown in Figure 1. As mentioned, the USB host includes
middleware. It is a collection of software elements including drivers, protocol stacks and class drivers. For an embedded system without an operating system, e.g. a ‘bare metal’ scenario, the middleware might also include a file system to format the data written to the USB flash drive.
ADDING USB? If you are developing an embedded system from scratch that requires USB then the good news is that there are many high-performance, low-power and low-cost micros with 8-, 16- and 32-bit architecture on the market that have built-in USB hosts. Moreover, some hosts feature the versatile On-The-Go (OTG) specification that allows switching between host and device; e.g. a camera is a device when connected to a computer but a host when connected to a printer. Also, OEM-provided firmware is designed to work with the chip from the outset, so integration will be easy, and so extensive is the use of USB that there will
16 FEBRUARY 2019 | ELECTRONICS
be hundreds of other developers already using the same devices. Through discussion groups you’ll benefit from tips and from like-minded individuals, plus memory device distributors are a mine of knowledge. Embracing a new micro with built-in
USB host is also an option if you are upgrading a current/legacy embedded system so that it can support USB; though switching micros is akin to giving the system a complete overhaul. An alternative is to stick with your
legacy micro and add a dedicated USB host controller. The costs to your system would include the USB host controller, any new system resources such as RAM (for code space required by the middleware) and an OS or RTOS. A dedicated USB host controller chip will
generally fall into one of three categories, and your selection of which to adopt will typically be governed by whether your system has enough resources to support an OS (or RTOS) and middleware – if needed. The categories are: ‘Standardised’. These implement a standard software interface and typically require an OS (or RTOS) plus middleware and will require extra RAM and flash storage. Standardised is a good choice if your system requires high-performance - such as Hi-Speed or SuperSpeed USB
‘Proprietary’. These implement a vendor-specific software interface and require the use of vendo-supplied or
user-written libraries. These may also require middleware that supports the proprietary interface. Proprietary is the route to take if your system needs even higher performance and can support middleware but not an OS or RTOS.
‘USB Host Peripherals’: These are self- contained embedded systems that feature a USB host controller and firmware that includes middleware, mass storage class and a file system. They are easy to implement and, in keeping with their minimalistic system footprint, their feature set and performance are somewhat limited. That said, they are quite capable of handling a wide variety of applications, so a USB host peripheral is ideal for resource-constrained systems in which moderate performance is acceptable
Figure 1:
Your embedded system will need the below USB host elements if you want to interface with a USB flash drive
SOFTWARE SUPPORT For many embedded applications, operating systems will be an attractive proposition (if not a must) as they include device drivers for many host controllers, the USB stack, a mass storage class driver and a file system. They also come with very powerful development tools. The downside is, as mentioned, that an OS requires considerable system resources, large amounts of flash and RAM. It also boots slowly.
Nexus Industrial Memory
www.nexusindustrialmemory.com T: 01794 732088
/ ELECTRONICS
Page 1 |
Page 2 |
Page 3 |
Page 4 |
Page 5 |
Page 6 |
Page 7 |
Page 8 |
Page 9 |
Page 10 |
Page 11 |
Page 12 |
Page 13 |
Page 14 |
Page 15 |
Page 16 |
Page 17 |
Page 18 |
Page 19 |
Page 20 |
Page 21 |
Page 22 |
Page 23 |
Page 24 |
Page 25 |
Page 26 |
Page 27 |
Page 28 |
Page 29 |
Page 30 |
Page 31 |
Page 32 |
Page 33 |
Page 34 |
Page 35 |
Page 36