FX3 USB_DEBUG_INTERFACE

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

cross mob
jali
Level 4
Level 4
25 replies posted 10 questions asked 50 sign-ins

Hello,

I'm debug the CYUSB3014 evb board base on the an75779 demo code, when I enable the USB_DEBUG_INTERFACE in uvc.h, and install the driver, but when I use the Control Center, it only can write once, and need write success again, I add a printf in the UVCAppEP0Thread_Entry, it nerver goto this function, I think it doesn't make sense, I attach the project, can you give some suggestions, thanks.

微信截图_20231129164654.jpg

0 Likes
1 Solution
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

When you enable USB_DEBUG_INTERFACE in the AN75779 code, it will add the CDC interface. So, I recommend you use the CDC driver instead of the cyusb3 driver. You can refer to this KBA to learn how to install the CDC Interface driver. Once bound, you can use any serial terminal like Tera-term to see the debug messages - sensor interface debugging.

You can also refer to this KBA to send debug messages over a CDC interface.

Regards,
Ajeeth

View solution in original post

0 Likes
7 Replies
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

When you enable USB_DEBUG_INTERFACE in the AN75779 code, it will add the CDC interface. So, I recommend you use the CDC driver instead of the cyusb3 driver. You can refer to this KBA to learn how to install the CDC Interface driver. Once bound, you can use any serial terminal like Tera-term to see the debug messages - sensor interface debugging.

You can also refer to this KBA to send debug messages over a CDC interface.

Regards,
Ajeeth

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Ajeeth,

Follow the KBA, I modify the cyfxuvcdscr.c, the UVC and cdc device emun successfully, UVC device works well, but doesn't works,  I check the bushound, there is no endpoint  under CDC  device, I have configure the endpoints for the channel created,  can you help on this, thanks a lot.

apiRetStatus = CyU3PSetEpConfig (CY_FX_EP_DEBUG_CMD, &endPointConfig);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "Debug Command endpoint config failed, Error code = %d\n", apiRetStatus);
        CyFxAppErrorHandler (apiRetStatus);
    }
 
    CyU3PUsbSetEpPktMode (CY_FX_EP_DEBUG_CMD, CyTrue);
 
    apiRetStatus = CyU3PSetEpConfig (CY_FX_EP_DEBUG_RSP, &endPointConfig);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "Debug Response endpoint config failed, Error code = %d\n", apiRetStatus);
        CyFxAppErrorHandler (apiRetStatus);
    }
 
    endPointConfig.enable   = 1;
endPointConfig.epType   = CY_U3P_USB_EP_INTR;
endPointConfig.pcktSize = 64;
endPointConfig.isoPkts  = 0;
endPointConfig.streams  = 0;
endPointConfig.burstLen = 1;

 

 

微信图片_20231130135829.jpg

0 Likes
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hello,

The source code with CDC is attached to the KBA which is working as expected. Please use this source code for your reference.

Regards,
Ajeeth

0 Likes

Hello Ajeeth,

I change the SDK from 1.3.5 to 1.3.3, it works😅

0 Likes

Hello Ajeeth,

The device can receive the data from host, but host will not revice data from device sometime, from the logs, I can make sure the code run and has no error code, can you give some suggestions? thanks.

 

dmaInfo.buffer = glDebugRspBuffer
                dmaInfo.size   = 1024;
                dmaInfo.count  = 511;
                dmaInfo.status = 0;
 
                /* Free the command buffer to receive the next command. */
                apiRetStatus = CyU3PDmaChannelDiscardBuffer (&glDebugCmdChannel);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "Failed to free up command OUT EP buffer, Error code = %d\r\n", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
                /* Wait until the response has gone out. */
                CyU3PDmaChannelWaitForCompletion (&glDebugRspChannel, CYU3P_WAIT_FOREVER);
                apiRetStatus = CyU3PDmaChannelSetupSendBuffer (&glDebugRspChannel, &dmaInfo);
                if (apiRetStatus != CY_U3P_SUCCESS)
                {
                    CyU3PDebugPrint (4, "Failed to send debug response, Error code = %d\r\n", apiRetStatus);
                    CyFxAppErrorHandler (apiRetStatus);
                }
                CyU3PDebugPrint (4, "CyU3PDmaChannelSetupSendBuffer\r\n");
0 Likes

Hello Ajeeth,

I have  check the KBA231478 code, There is no API can receive the cmd from host, and I don't want to use CyU3PDebugPrint(4, "cdc-debug-enabled\r\n"), send the data to host, I need send the data to host by HEX, how can I change the code?

0 Likes
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

The debug interface mentioned in the above KBA is mentioned to send Human readable string using serial terminals like Tera Term.

If you wish to send the raw data, you can use CyU3PDmaChannelGetBuffer to get the buffer, Copy the data to the buffer as required, CyU3PDmaChannelCommitBuffer API to send the data to the USB Host.

For more details about adding a CDC interface to any application, refer to this KBA.

Regards,
Ajeeth

0 Likes