A control endpoint is used to send configuration, command, and status requests between the host and a USB device.
All USB devices are required to implement Endpoint 0 (EP0), also known as the Default Control Endpoint — it is the only endpoint that exists before enumeration and is the means by which the host configures every device.
Endpoint 0 (Default Control Endpoint)
| Property | Value |
|---|---|
| Endpoint Number | 0 |
| Direction | Bidirectional (IN + OUT) |
| Transfer Type | Control |
| Mandatory? | Yes — every USB device |
| Max Packet Size (LS) | 8 bytes |
| Max Packet Size (FS) | 8, 16, 32, or 64 bytes |
| Max Packet Size (HS/SS) | 64 bytes (HS), 512 bytes (SS) |
EP0 handles:
- Standard USB requests defined by the USB specification
- Class-specific requests defined by device class specifications
- Vendor-specific requests for proprietary device functions
Standard USB Requests
The host uses EP0 to send standard requests defined by the USB specification. Each request is sent as an 8-byte Setup Packet.
Setup Packet Format
| Field | Size | Description |
|---|---|---|
bmRequestType |
1 | Direction, type (standard/class/vendor), recipient |
bRequest |
1 | Specific request code |
wValue |
2 | Request-specific parameter |
wIndex |
2 | Interface or endpoint index |
wLength |
2 | Number of bytes to transfer in the Data Stage |
Common Standard Requests
| Request | Code | Purpose |
|---|---|---|
GET_DESCRIPTOR |
0x06 | Read device/config/string descriptors |
SET_ADDRESS |
0x05 | Assign a unique address (1–127) |
SET_CONFIGURATION |
0x09 | Activate a device configuration |
GET_STATUS |
0x00 | Read device/interface/endpoint status |
CLEAR_FEATURE |
0x01 | Clear a feature (e.g., clear endpoint HALT) |
SET_FEATURE |
0x03 | Enable a feature (e.g., remote wakeup) |
GET_CONFIGURATION |
0x08 | Read the current active configuration value |
SET_INTERFACE |
0x0B | Select an alternate setting for an interface |
Class-Specific Requests
Many device classes define additional requests sent over EP0.
| Device Class | Example Request | Purpose |
|---|---|---|
| HID | GET_REPORT / SET_IDLE |
Obtain input reports, set idle rate |
| Hub | GET_PORT_STATUS / SET_PORT_FEATURE |
Monitor and control downstream ports |
| Audio | SET_CUR / GET_CUR |
Set volume, sampling rate, mute |
| Mass Storage | Bulk-Only Mass Storage Reset |
Reset the bulk-only transport interface |
| CDC | SET_LINE_CODING |
Set baud rate, data bits, parity |
Control Transfer Structure
A control transfer consists of two or three transaction stages and follows a strict sequence:
Stage Breakdown
┌─────────────────────────────────────────────────────┐
│ Control Transfer │
│ │
│ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ SETUP │───►│ DATA │───►│ STATUS │ │
│ │ Stage │ │ Stage │ │ Stage │ │
│ │(always)│ │(option)│ │(always)│ │
│ └────────┘ └────────┘ └────────┘ │
└─────────────────────────────────────────────────────┘
| Stage | Required? | Description |
|---|---|---|
| Setup | Always | Host sends an 8-byte Setup Packet (request details) |
| Data | Optional | One or more data transactions in the specified direction |
| Status | Always | Opposite-direction handshake confirming success |
Direction Rules for the Status Stage
| Transfer Direction | Data Stage Direction | Status Stage Direction |
|---|---|---|
| Control Read (IN) | Device → Host | Host → Device (zero-length OUT) |
| Control Write (OUT) | Host → Device | Device → Host (zero-length IN) |
| No Data | None | Device → Host (zero-length IN) |
The Status Stage always uses the opposite direction of the Data Stage. This ensures both sides explicitly confirm the transfer completed successfully.
Functions of the Default Control Endpoint
Device Initialization (during enumeration)
- Resetting the device to a known state
- Assigning a unique USB address (
SET_ADDRESS) - Reading all descriptors (
GET_DESCRIPTOR) - Selecting and activating a configuration (
SET_CONFIGURATION)
Runtime Device Management
- Getting status information (
GET_STATUS) - Enabling or disabling features (
SET_FEATURE/CLEAR_FEATURE) - Clearing a stalled endpoint (
CLEAR_FEATURE(ENDPOINT_HALT))
Hub Management
- Reading port status (
GET_PORT_STATUS) - Resetting downstream ports (
SET_PORT_FEATURE(PORT_RESET)) - Managing connection and disconnection events
Power Management
- Suspending devices (
SET_FEATURE(DEVICE_REMOTE_WAKEUP)) - Resuming devices from suspend
Class-Specific Control
- Sending commands required by specific USB device classes (see table above)
Why EP0 Is Essential
EP0 is the only guaranteed communication channel on any USB device. Without it, the host cannot:
- Discover the device (read descriptors)
- Assign it an address
- Configure it for operation
- Load the correct driver
The enumeration process depends entirely on EP0 for every step.