cyusb3014 self-power cannot renumerate after usb3.0 cable reconnect

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KeDu_4661041
Level 1
Level 1

HI Everyone,

The cyusb3014 in our board is self-powered through VBATT. The device cannot be renumerated after the usb cable reconnect while the VBATT power is kept.

I though this is caused by the firmware is running, and 3014 is not reset under this condition.

I add the following code to try solve the problem. But it didnot work. What di i do wrong?

In function SlFifoAppThread_Entry() the for loop:

void SlFifoAppThread_Entry(uint32_t input)

{  

     ......

     /* Initialize the slave FIFO application */    

     CyFxSlFifoApplnInit();   

     for (;;)   

     {        

          apiRetStatus = CyU3PGetConnectState();     //chech whether vbus is connected.

          if(apiRetStatus == CyFalse)    

               glIsDeviceRemoved = CyTrue;    

          if(apiRetStatus && glIsDeviceRemoved)     //if the vbus return to high voltage, then reset the CPU and rerun the fireware for PC enumerate.

          {   

               glIsDeviceRemoved = CyFalse;   

               CyU3PDeviceReset(CyFalse);    

          }

      }

}

I also tried the sample code in cyfxlowpowertest.c but it doesnot work. Maybe those reasons make it useless.

1. The CY_U3P_USB_EVENT_VBUS_REMOVED signal cannot be invoked by usb3.0 cable removed in

void CyFxApplnUSBEventCB (CyU3PUsbEventType_t evtype,  uint16_t  evdata).

2. The firmware cannot go into standby mode, because the peripheral blocks is not disabled with power on.

3. The suspendmode is not usefull because it need PC send cmd to cyusb3014.

4. The CY_U3P_SYS_UART_WAKEUP_SRC cannot be used because we use spi flash for 3014 boot, so the uart pin is used for SPI.

0 Likes
1 Solution

Hello,

The CyU3PUsbStart() and CyU3PConnectState(CyTrue, CyTrue) is called in CyFxSlFifoApplnInit().

>> Please let me know if CyU3PConnectState returns CY_U3P_SUCCESS if the above mentioned sequence is followed in your firmware

Please try calling the CyU3PUsbStart() and register for the USB event callback after that at the entry function SlFifoAppThread_Entry .

CyU3PConnectState() can be called when CY_U3P_USB_EVENT_VBUS_VALID event is seen

CyFxSlFifoApplnUSBEventCB (CyU3PUsbEventType_t evtype, uint16_t  evdata)

{

    switch (evtype)

    {

         case: CY_U3P_USB_EVENT_VBUS_VALID:

                   CyU3PConnectState(); //check the return value of this API

                   break;

        case CY_U3P_USB_EVENT_SETCONF:

        case CY_U3P_USB_EVENT_RESET:

        case CY_U3P_USB_EVENT_DISCONNECT:

            // Stop the application before re-starting.

            if (glIsApplnActive)

            {

                CyFxSlFifoApplnStop ();

            }

            // Start the loop back function.

            CyFxSlFifoApplnStart ();

            glIsDeviceRemoved = CyFalse;

            break;

     }

}

Please let me know if this works

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
3 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please let me know when do you start the USB block using CyU3PUsbStart API in the firmware and how do you plan to connect the USB by calling CyU3PConnectState() API.

To check if VBUS is power is detected or not, you can register for USB events using CyU3PUsbRegisterEventCallback API.

When CY_U3P_USB_EVENT_VBUS_VALID event is seen you can try connecting the USB device using CyU3PConnectState() API.

You can refer to UsbBulkSrcSink firmware of the FX3 SDK for registering the USB event callback CyU3PUsbRegisterEventCallback

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

The CyU3PUsbStart() and CyU3PConnectState(CyTrue, CyTrue) is called in CyFxSlFifoApplnInit(). CyFxSlFifoApplnInit() is invoked in entry function SlFifoAppThread_Entry. CyFxSlFifoApplnStart config the endpoint and dma channel.

This is the callback function CyFxSlFifoApplnUSBEventCB:

CyFxSlFifoApplnUSBEventCB (CyU3PUsbEventType_t evtype, uint16_t  evdata)

{

    switch (evtype)

    {

        case CY_U3P_USB_EVENT_SETCONF:

        case CY_U3P_USB_EVENT_RESET:

        case CY_U3P_USB_EVENT_DISCONNECT:

            // Stop the application before re-starting.

            if (glIsApplnActive)

            {

                CyFxSlFifoApplnStop ();

            }

            // Start the loop back function.

            CyFxSlFifoApplnStart ();

            glIsDeviceRemoved = CyFalse;

            break;

     }

}

I will try the TriggerStandbyMode code in UsbBulkSrcSink firmware. Thanks.

0 Likes

Hello,

The CyU3PUsbStart() and CyU3PConnectState(CyTrue, CyTrue) is called in CyFxSlFifoApplnInit().

>> Please let me know if CyU3PConnectState returns CY_U3P_SUCCESS if the above mentioned sequence is followed in your firmware

Please try calling the CyU3PUsbStart() and register for the USB event callback after that at the entry function SlFifoAppThread_Entry .

CyU3PConnectState() can be called when CY_U3P_USB_EVENT_VBUS_VALID event is seen

CyFxSlFifoApplnUSBEventCB (CyU3PUsbEventType_t evtype, uint16_t  evdata)

{

    switch (evtype)

    {

         case: CY_U3P_USB_EVENT_VBUS_VALID:

                   CyU3PConnectState(); //check the return value of this API

                   break;

        case CY_U3P_USB_EVENT_SETCONF:

        case CY_U3P_USB_EVENT_RESET:

        case CY_U3P_USB_EVENT_DISCONNECT:

            // Stop the application before re-starting.

            if (glIsApplnActive)

            {

                CyFxSlFifoApplnStop ();

            }

            // Start the loop back function.

            CyFxSlFifoApplnStart ();

            glIsDeviceRemoved = CyFalse;

            break;

     }

}

Please let me know if this works

Regards,

Rashi

Regards,
Rashi
0 Likes