DWC2 host controller

From SEGGER Wiki
Jump to: navigation, search

There is an issue with the DWC2 host controller hardware:

The DWC2 controller has a couple of channels that can be used to perform USB transfers. To start an USB transfer a channel has to be initialized and enabled. After the transfer has been completed the channel must be halted and disabled. Then the channel can be re-used to perform other transfers. Multiple channels can be used to schedule multiple transfers in parallel.

Because of an issue of the USB controller hardware, sometimes a channel can't be halted/disabled after a transfer. Instead the channel remains in an undefined state and can't be used for new transfers. This mainly happens after interrupted transfers, when a device is disconnected in the middle of a packet transfer, but the exact cause it not clear.

The emUSB-Host driver implements some recovery mechanism to get stuck channels working again: It tries to halt/disable these channels multiple times. This results in the warning messages "Re-trigger channel halt / disable". It sometimes works and the channel get operational again. If this does not work after some time, the channel is stuck and can't be used any more until a reset of the USB controller (message "channel x is dead!"). The driver continues working using the remaining channels.

It may happen, that the driver runs out of channels in that way and can't service all transfer requests of the USB stack. The driver will issue a warning "No free channels" in this case. This may cause the USB stack to drop connected devices or get not operational at all.

The driver implements another workaround: If there are dead channels and the root device is disconnected then the USB controller is reset to recover all channels. This does not work if using a hub until the hub is disconnected.