« USB - Bus Protocol | Home | USB - Transfer Speeds »
USB - Error Handling
By admin | April 28, 2007
Considerable error checking and error handling features have been built in to the USB to ensure that it is a reliable method of connecting peripherals to a PC. Data integrity should be comparable to that of an internal expansion bus.
Immunity from data corruption by noise and spikes has been provided by the use of differential logic drivers and shielded cabling. When errors do occur, cyclic redundancy checks (CRCs) performed separately on both the control and data fields of packets will enable 100 per cent recovery of both single and double bit errors. Unrecoverable errors can be detected with a high degree of confidence.
A self-recovery mechanism is built into the messaging protocol, with time-outs for lost and invalid packets. Some error recovery is built into the hardware. The host controller will retry a failed transaction three times before reporting an error to the client software. How a reported error is dealt with is the responsibility of the client software.
Interrupt and bulk data transfers conclude with a handshake packet to provide confirmation that the data was received, or request that it be re-sent if it was not. Delivery of this data is therefore guaranteed, even if the time taken to deliver it is not.
With isochronous data it is not possible to retry a failed transaction. Since only one ‘slot’ is allocated to the pipe during each frame, resending the data would delay transmission of the succeeding data samples, upsetting the time element of the data delivery. Consequently no handshake packet is sent and the data must be accepted ‘as is.’
Topics: Computers & Software |
