MAX32665-MAX32668 User Guide
Maxim Integrated Page 405 of 457
21.6 Packet Size
For all transfers the packet size is specified in the USBHS_INMAXP register for IN endpoints and the USBHS_OUTMAXP
register for OUT endpoints. These registers specify the size of the entire transactions.
21.7 Endpoint 0 Control Transactions
Endpoint 0 (EP0) is the main control endpoint and handles all USB Standard Device Requests for control transfers. There are
three types of Standard Device Requests:
1. In Zero Data Requests, all the information for the request is included in an 8-byte command.
2. In Write Requests, the command from the USBHS is followed by additional data.
3. In Read Requests, the USBHS is communicating with a USB Device that is required to send data back to the Host.
21.7.1 Endpoint 0 Error Handling
The USBHS can detect and generate interrupts for control transfers errors. It sends a STALL packet on the bus and generates
an interrupt if the incorrect amount of data is transferred over the bus. This can happen under the following conditions:
1. The Host sends more data during the OUT Data phase of a write request than the amount specified in the
command. This condition is detected when the Host sends an OUT token after the Data End bit
USBHS_CSR0.dataend is set by firmware.
2. The Host requests more data during the IN Data phase of a read request than the amount specified in the
command. This condition is detected when the Host sends an IN token after the DataEnd bit USBHS_CSR0.dataend
is set by firmware.
3. The Host sends more data in an OUT data packet than the amount specified in the USBHS_OUTMAXP register.
4. The Host sends a non-zero length DATA1 packet during the STATUS phase of a read request.
An error occurs if a control transaction ends prematurely. This can happen if the USB Host enters the STATUS phase before
all data has been transferred. This can also occur if a USB Host transmits a new SETUP packet before finishing the current
control transaction. In both cases, the USBHS_CSR0.setupend bit is set, which generates an Endpoint 0 interrupt.
If the USBHS_CSR0.outpktrdy bit is set, this indicates that the Host has sent another SETUP packet. Firmware should then
process the command in that packet.
21.8 Bulk Endpoints Operation and Options
21.8.1 Bulk IN Endpoints
A Bulk IN endpoint is used to transfer high-volume data that does not require real-time processing. Five features are
available for use with a Bulk IN endpoint as shown in Table 21-2.
Table 21-2: USB Bulk IN Endpoints Options