- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you print "length" value in host app before calling "XferData", "length" must be grate then 128.
Best Regards,
Biren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you print "length" value in host app before calling "XferData", "length" must be grate then 128.
Best Regards,
Biren