Exception Handling; Unable To Complete Device Request; Aborted Device Request; Unable To Fill Or Empty Fifo Due To Temporary Problem - Motorola DragonBall MC9328MX1 Reference Manual

Integrated portable system processor
Table of Contents

Advertisement

USB Device Port

28.6 Exception Handling

Exception handling occurs in two situations:
When corrupted frames must be discarded
When an error occurs on the USB
The hardware automatically discards corrupted frames, so no software intervention is required.
If the device cannot respond to the host in the time allotted, the hardware automatically handles retries. No
software intervention is required.
There are four error situations that must be dealt with by the software:

Unable to Complete Device Request

Aborted Device Request

Unable to Fill or Empty FIFO Due to Temporary Problem

Catastrophic Error.
Explanations for each of the errors are described in the following sections.
28.6.1 Unable to Complete Device Request
In the event that the software receives a device request it cannot interpret, it asserts the CMD_ERROR and
CMD_OVER bits (in the USB_CTRL register) to the UDC. This results in a STALL to the endpoint in
question and requires intervention from the USB host to clear. When the CMD_OVER bit clears, it means
that the USB host has cleared the stall condition.
28.6.2 Aborted Device Request
When the host sends a setup packet to the device, the ACK handshake from the device can become
corrupted and lost on its way to the host. If this happens, the host retries the setup packet, and the device
can wind up with two or more setup packets in its FIFO. There are two ways to detect this condition:
The presence of a MDEVREQ interrupt (in the USB_EPn_INTR register)
The SIP bit in the Endpoint n Status/Control Register (USB_EPn_STAT) is active
In either case, the presence of more than one setup packet invalidates the first one in the FIFO. When
MDEVREQ is active, software must discard the first one, and process the second one. When SIP is active,
software must discard the first one, clear the device request, and wait for it to reassert.
28.6.3 Unable to Fill or Empty FIFO Due to Temporary Problem
When the USB module is unable to fill or empty a FIFO due to a temporary problem (such as the OS did
not service the FIFO in time and it overflowed), the software stalls the endpoint through the
FORCE_STALL bit in the USB_EPn_STAT register. This aborts the transfer in progress and forces
intervention from the USB host to clear the stall condition. The FORCE_STALL register bit automatically
clears after the stall takes effect. The application software on the host must deal with the stall condition and
notify the device on how to proceed.
28-38
MC9328MX1 Reference Manual
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents