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

USB superspeed peripherals Forum Discussions

ankitvats846
Level 2
10 replies posted 10 sign-ins 5 questions asked
Level 2

Hi , on my device there no UART pins. 

I take the reference of "cyfxusbdebug" example code to print the Debug messages on USB interface. 

I configure the Endpoint as interrupt endpoint. 

epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_INTR;
epCfg.burstLen = (usbSpeed == CY_U3P_SUPER_SPEED) ? (BURST_LEN) : 1;
epCfg.streams = 0;
epCfg.pcktSize = size;

/* Interrupt  endpoint configuration */
 CyU3PSetEpConfig(CY_FX_EP_DEBUG, &epCfg);

After that I make the entry this endpoint on "cyfxusbdscr.c"   in   CyFxUSBSSConfigDscr[], CyFxUSBHSConfigDscr[],CyFxUSBFSConfigDscr[]  descriptors 

 

And Host application retrieve the data through interrupt endpoint.

while (1)
{
// cout << "In Thread" << endl;
if ((lpParams->IsOpen() == TRUE) && 1)
{
if (lpParams->InterruptInEndPt)
{
length = lsize - 1;
if ((lpParams->InterruptInEndPt->XferData(fInBuf, length) == FALSE))
{
Sleep(100);
cout << "InterruptInEndPt->XferData Failure!" << endl;
}
else
{
cout << "RD= " << length << endl;
if (length == 0)
{
cout << "IN THREAD LENGTH_0" << endl;
#if 0
if ((m_bLogFileOpenFlag == TRUE))
{
fclose(wrLogFile);
m_bLogFileOpenFlag = FALSE;
}
#endif
Sleep(100);
}
else
{
cout << "IN THREAD LENGTH_NON_0" << endl;
fInBuf[length + 1] = '\0';
#if 0
if (m_bLogFileOpenFlag == FALSE)
{
wrLogFile = fopen(DEBUF_FILE_NAME, "a+"); //TODO FIle check
m_bLogFileOpenFlag = TRUE;
}
#endif
// Sleep(100);
wrLogFile = fopen("./Fwlog.txt", "a+");
fwrite((fInBuf /*+ 8*/), 1, length, wrLogFile);
fclose(wrLogFile);
}
}
}
else
{
cout << "No Interrupt Endpoint on Device" << endl;
break;
}
}

this error 

InterruptInEndPt->XferData Failure! 

 The Debug are not coming ??

0 Likes
1 Solution
Biren
Moderator
Moderator 50 solutions authored 10 likes received 100 replies posted
Moderator

Hello,

Can you print "length" value in host app before calling "XferData", "length" must be grate then 128.

Best Regards,
Biren

View solution in original post

0 Likes
1 Reply
Biren
Moderator
Moderator 50 solutions authored 10 likes received 100 replies posted
Moderator

Hello,

Can you print "length" value in host app before calling "XferData", "length" must be grate then 128.

Best Regards,
Biren

0 Likes