Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
How to handle CY_U3P_USB_EVENT_LMP_EXCH_FAIL event during USB enumeration from the FX3 SDK?
FX3 SDK signals the CY_U3P_USB_EVENT_LMP_EXCH_FAIL event to the user application when either of Port Capability Request or Port Configuration Request from the host is timed out. Cypress recommends a USB Interface Block restart in the user application while handling this event.
The following steps show how to handle the event for a sample application project:
1.Configure the USB Event callback to set a custom flag CY_FX_USB_RESTART_EVT_FLAG to the main application event on receiving the CY_U3P_USB_EVENT_LMP_EXCH_FAIL event.
2. Use the CyU3PEventGet API to receive the custom event flag (CY_FX_USB_RESTART_EVT_FLAG) in the application thread entry function. Note that the event mask (evMask) should be configured to receive the CY_FX_USB_RESTART_EVT_FLAG. The CyFxAppUsbRestart() function reinitializes the USB Interface Block. The source code of CyFxAppUsbRestart() is included in the attached sample project.
/* Handling the custom event in application thread */
status = CyU3PEventGet (&glApplnEvent, evMask, CYU3P_EVENT_OR_CLEAR, &evStat, CYU3P_WAIT_FOREVER);
if (status == CY_U3P_SUCCESS)
if (evStat & CY_FX_USB_RESTART_EVT_FLAG)
These steps are applicable to FX3, FX3S, CX3 and SD3.
The attachment, USBBulkLoopAuto.zip, is the modified version of the USBBulkLoopAuto FX3 SDK example project. Search for HANDLE_LMP_EXCH_FAIL_EVT in the cyfxbulklpauto.c file for the relevant modifications.