Comparative analysis of the basic differences between USB 2.0 and USB 3.0

USB is popular in the market due to its simplicity, maturity, and plug-and-play characteristics. However, the speed of USB 2.0 480 Mbps cannot support the new generation of storage and video. Therefore, the time was ripe for porting to a faster standard, which led to the development of the new USB 3.0 protocol. For developers, the challenge is how to fully utilize the potential of USB 3.0. This article will discuss the use of USB 3.0 hardware and software design issues, this article mainly introduces the handheld products. First, we’ll compare the performance of USB 2.0 and USB 3.0, and the device impact of transitioning to USB 3.0 modules.

USB is popular in the market due to its simplicity, maturity, and plug-and-play characteristics. However, the speed of USB 2.0 480 Mbps cannot support the new generation of storage and video. Therefore, the time was ripe for porting to a faster standard, which led to the development of the new USB 3.0 protocol. For developers, the challenge is how to fully utilize the potential of USB 3.0. This article will discuss the use of USB 3.0 hardware and software design issues, this article mainly introduces the handheld products. First, we’ll compare the performance of USB 2.0 and USB 3.0, and the device impact of transitioning to USB 3.0 modules.

In a common scenario, on the device side, the processor is directly connected to USB, storage and peripherals. With this structure in mind, the transition from High-Speed ​​to SuperSpeed, the impact of the processor can be summarized as follows:

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

USB 2.0 vs USB 3.0

data rate

The basic difference between USB 2.0 and USB 3.0 is bandwidth. The theoretical bandwidth provided by USB 2.0 is 480Mbps. In fact, the maximum throughput received is about 320Mbps (40MBps), which is roughly two-thirds the theoretical value. Using USB3.0, the data throughput is 4.8Gbps. If we use the same scale, then the expected data rate is 3.2Gbps (400MBps). However, many developers want to provide higher throughput. Figure 1 shows the difference in data rates between USB 3.0 and USB 2.0 for different size file transfers using Buffalo external storage disks. It should be noted that USB 3.0 data rates are constrained by storage devices, otherwise data rates of 400 Mbps are easily attainable.
  

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

As can be seen from Figure 1, the transfer size of a single request increases, and the data transfer rate also increases. This is because when the request transfer size increases, the number of requests and therefore the interrupts to be handled by the MSC device decreases, and the overall performance is better. After the 64 KB transfer, the data rate saturates (because the Windows driver cannot request more than 64 KB in one SCSI request). These data show the importance and impact of outages on overall system performance.

A high data rate increases the interrupt rate and data request rate, which significantly increases the processor load. When the processor is busy processing USB-related real-time requests, adding latency, the user will see application processing slow down, which is not a satisfactory result.

data flow

USB 2.0 data requests can only be in one direction at a time, and unlike the USB 2.0 standard, USB 3.0 supports simultaneous read and write. This is because USB 2.0 is a half-duplex protocol, while USB 3.0 is a full-duplex protocol. Full-duplex communication supports simultaneous transmission of data by adding more connections. It also brings increased cost and software complexity. With USB 2.0, the processor is only involved in the transfer at a time, and the data structures and request handling are very simple. But with the advent of full-duplex USB 3.0, today’s data structures require double the amount of information. The USB software module also needs to be able to handle simultaneous data operations.

power management

The packet transfer protocol has changed (eg, broadcast orientation), device polling has been eliminated, and the definition of link and function-level intermediate states makes USB 3.0 power management very good. We’ll discuss what the USB device processor has to do as the third power reduction changes, such as multiple intermediate states.

In USB 2.0, the states are only ACTIVE and SUSPEND. There are more than two states in SuperSpeed: FAST EXIT IDLE and SLOW EXIT IDL. More states means more complexity in both hardware and software. Peripherals can initiate power-saving modes using link-level power management. To gain real benefit, the processor needs to track the idle time of the USB interface and act intelligently. The ingress and egress rates of the power connection state may be frequent for a device. For example, isochronous transfers allow peripherals to enter a low-power state during service intervals. This can significantly increase the processor load runtime.

Streaming support

USB3.0 expands the batch transfer mode and supports streaming mode. Bulk Streaming provides co-band signaling and supports multiple independent logical data stream protocols through a standard bulk transfer. This approach simplifies the complex class protocol of USB design. For example, the USB SCSI (UAS) mass storage class uses bulk streaming instead of the simple BOT protocol. In BOT there is only one pending request at a time, while in UAS there may be n-1 requests at a time, where n is the number of streams supported in the bulk endpoint. Implementing and maintaining a complex class protocol can also keep the processor busy. A single flat data structure is sufficient for the BOT, and the UAS protocol requires a priority-based data structure for implementing peripheral-side firmware.

Structure Analysis of Commonly Used USB Devices

Considering that mass storage devices are the most common high-performance USB peripherals on the market, we will give an example of a mass storage device to precisely analyze its performance.
  

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

We’ll discuss the data side because most of the time the interface will involve data packet transfers rather than control packets.

Data transfer steps:

1. The processor received a USB request.

2. The handler handles this request.

3. The processor stores read/write requests in turn.

4. The processor waits for the transfer to complete.

5. Processor sends completion to USB host

The time structure of this transfer

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

Here, X, Y and Z are the main delay components, explained as follows:

1. Latency X is the time it takes to transmit a request packet between the host and the processor. It depends on the USB protocol and the USB device hardware processing efficiency. The request packet size is only a few tens of bytes, so the latency is only a few nanoseconds.

2. Latency Y represents the time it takes the processor to process the USB request and establish a direct memory access. It depends on processor type, number of threads/processes, software architecture. For general-purpose processors handling a large number of processes and tasks, the operating system processing latency may depend heavily on interrupt latency, content switching latency, queue latency, etc. In the worst case, the delay Y may reach hundreds of microseconds.

3. Latency Z refers to the time it takes for data to transfer between the USB and the storage device, depending on the request type. Also depends on the direct memory access structure and the storage device type, not on the USB speed, as the bottleneck here would be the storage speed rather than the USB speed (like SuperSpeed). Latency Z may be between milliseconds and microseconds, depending on storage device type and data size.

Although USB is ten times faster (from 480Mbps to 5Gbps), the real throughput will be much lower than theoretical, because USB latency (X) is faster than OS processing latency (Y) and storage transfer latency (Z) Much smaller, it is negligible relative to the total delay. Z-latency can be improved by choosing better storage devices, but Y-latency needs to be managed through more efficient system design.

efficient

To realize the full potential of USB 3.0, the following changes are required:

High-Performance Processors: The complexity and number of tasks handled by processors due to USB 3.0 will increase dramatically. If you want other application performance to be unaffected, you need a powerful processor.

Impact: Not only will this increase product cost, but it will also increase power consumption, which is bad for handheld devices.

The existing system architecture must be changed to accommodate USB 3.0. At the same time, if the full potential of USB 3.0 is to be realized, high-capacity and high-performance storage devices are required.

Impact: This will increase the complexity of the system, thus impacting time-to-market and project risk.

Redesigned to improve performance

There is no need to connect the USB controller to a general purpose processor (GP), it can be connected to an I/O module. This type of I/O module is called an I/O channel, where the I/O module is enhanced as an independent processor. The GP directs the I/O channels to execute programs in main memory. The I/O channel takes these instructions and executes them without GP intervention. The GP just generates an interrupt when the entire sequence is complete.

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

Westbridge devices are designed for this operation and can significantly improve performance. Since the total delay of data transfer depends on the processing delay, this delay is greatly reduced when using the West Bridge architecture.

The main factor that affects general-purpose processor performance depends on the frequency of interrupts. In short, every time the GP receives an interrupt, the content needs to be switched, the ISR is executed, increasing the time for other running programs. When using the West Bridge device, most of the USB related interrupts are handled by it, thus improving the performance of the GP.

Below is a performance test of a 15.1 GB Embedded Multimedia Card (eMMC) using mass storage class driver enumeration. The GP had to deal with a lot of interruptions without the West Bridge. The following figure depicts the processing results of each task of the system. The number of interruptions is log2 units.

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

Comparative analysis of the basic differences between USB 2.0 and USB 3.0

The Links:   AT070TN07-VB LM215WF3-SJJ5

Leave a Reply

Your email address will not be published.