Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1 29
received on the endpoint, the data will sit in the buffer and will not be accessible to
the consumer.
If this behavior is undesirable, the endpoint behavior can be modified using the
CyU3PSetEpPacketSize() or CyU3PUsbSetEpPktMode() APIs.
The CyU3PSetEpPacketSize() API allows the maximum packet size definition for
the endpoint to be modified such that all incoming packets are treated as short
packets, resulting in immediate buffer commit. For example, if this API is used to
set the maximum packet size as 1024 bytes in the above case, all 512 byte packets
will be treated as short packets; and made available to the consumer immediately.
The CyU3PUsbSetEpPktMode() API configures the endpoint in packet mode,
where it commits each incoming data packet into one DMA buffer (independent of
whether it is full or short). The downside of this approach is that it can limit data
transfer performance in some cases. It is recommended that the packet mode not
be used for any applications that use large DMA buffers for better performance.
5.4.4 USB Low Power Mode Handling
The USB 3.0 specification includes provision for link level low power modes which
are used to save system power consumption when the link is idle. It has been
noted that different host controllers (in some cases even the host controller drivers)
use the low power modes differently. In some cases, the host is very aggressive
and tends to push the link into U1/U2 modes whenever it is waiting for data from
the device. In other cases, the host waits a little longer before trying to initiate a
transition into a low power mode.
The FX3 device handles U1/U2 transitions passively in most cases, because the
device cannot initiate a U0->Ux transition without firmware intervention. Due to this
constraint, the normal power mode handling in FX3 involves the device accepting
or rejecting low power mode requests from the host; and then initiating a transition
back to the U0 mode when instructed by firmware.
By default, the device is placed in a state where it accepts or rejects low power
mode requests automatically based on whether it has any data ready to send out or
not. This behavior can be overridden to a state where it systematically rejects all
attempts by the host to push the link into a low power mode. This change is
requested through the CyU3PUsbLPMDisable () API.
The use of this API is recommended if the power mode transitions on the USB link
are limiting the performance of the system to unacceptable levels.
The FX3 device does not automatically initiate a transition back to U0 (from U1/U2)
when it has data ready to go out. In the case of control transfers, the USB driver in
the FX3 firmware is aware that data is ready; and initiates a transition back to U0 at
the appropriate time.
In the case of other endpoints, it is possible that the data transfer be blocked
because the link is stuck in a low power mode. It is recommended that any
applications that do not use the CyU3PUsbLPMDisable() API, should call the