cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

PrM_1403381
New Contributor II

Hi,

I am using Cypress Fx3 DVK (CYUSB3KIT-003), In cypress errata I found about above mentioned subject.

So in firmware, In CyFxUSBEventCB function in CY_U3P_USB_EVENT_SETCONF function I am making LPM disable CyU3PUsbLPMDisable(), and I am not making enable anywhere. I sthis method of making LPM disable is correct or any other way I need to handle.

Here is the snippet of my CyFxUSBEventCB function:

void

CyFxUSBEventCB (

    CyU3PUsbEventType_t evtype, /* Event type */

    uint16_t            evdata  /* Event data */

    )

{

    switch (evtype)

    {

    case CY_U3P_USB_EVENT_CONNECT:

        case CY_U3P_USB_EVENT_SETCONF:

            /* Stop the application before restarting. */

            if (glIsApplnActive)

            {

                CyFxIntrSrcSinkApplnStop ();

            }

            CyU3PConnectState(CyTrue, CyTrue);

            CyU3PUsbLPMDisable();

            CyFxIntrSrcSinkApplnStart ();

            CyU3PUsbStart();

            break;

        case CY_U3P_USB_EVENT_RESET:

        case CY_U3P_USB_EVENT_DISCONNECT:

            /* Stop the loop back function. */

            if (glIsApplnActive)

            {

                CyFxIntrSrcSinkApplnStop ();

            }

            break;

        default:

            break;

    }

}

■Workaround

This problem can be worked around in the FW by disabling LPM (Link Power Management) during data transfer.

Since it is mentioned that during data transfer means where I need to disable LPM ?

Best Regards

Prasanna

0 Likes
1 Solution
YashwantK_46
Moderator
Moderator

Hello Prasanna,

If your end application is based on UVC, the device can have LPM enabled as soon as DMA channels are created using CyU3PUsbLPMEnable() to save power and use CyU3PUsbLPMDisable() before starting streaming and transferring data.

The device should also enter LPM when the streaming stops to save power or when the host sends LPM requests to the device to go into LPM.

You can go through the example firmware from AN75779 from the link: https://www.cypress.com/file/123501/download

If the end application is not UVC, you can go through UsbBulkSrcSink example from the SDK path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink

This example frimware also has an implementation of LPMEnable and LPMDisable which puts the device in LPM when a timer expires.

Both of these firmwares can pass the compliance tests and similar implementation can be used.

Regards,
Yashwant

View solution in original post

0 Likes
3 Replies
YashwantK_46
Moderator
Moderator

Hi Prasanna,

The code snippet implementing CyU3PUsbLPMDisable() API is correct.


There is no need to use CyU3PUsbLPMEnable() during normal operation unless you want the device to pass USB compliance tests.

If you want the device to go to low power mode, you will have to use CyU3PUsbLPMEnable() to handle the low power requests from host in the CyFxApplnLPMRqtCB() function in the firmware and register a callback for the same.

Regards,

Yashwant

0 Likes
PrM_1403381
New Contributor II

Hi Yashwant,

Thanks for the response.

If I want to run compliance test also in same FW and also overcome the Cypress errata regarding LPM. How it can be handled ?

Thanks & Regards

Prasanna

0 Likes
YashwantK_46
Moderator
Moderator

Hello Prasanna,

If your end application is based on UVC, the device can have LPM enabled as soon as DMA channels are created using CyU3PUsbLPMEnable() to save power and use CyU3PUsbLPMDisable() before starting streaming and transferring data.

The device should also enter LPM when the streaming stops to save power or when the host sends LPM requests to the device to go into LPM.

You can go through the example firmware from AN75779 from the link: https://www.cypress.com/file/123501/download

If the end application is not UVC, you can go through UsbBulkSrcSink example from the SDK path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink

This example frimware also has an implementation of LPMEnable and LPMDisable which puts the device in LPM when a timer expires.

Both of these firmwares can pass the compliance tests and similar implementation can be used.

Regards,
Yashwant

View solution in original post

0 Likes