USB superspeed peripherals Forum Discussions
text.format{('custom.tabs.no.results')}
Hi!
I've noticed first of all that when I set packets per transfer to 256 while trimming the queuing,
the throughput stays quite constat (180MB/s) till 32 transfers to queue, but asap I set the queue to 64 the PC restarts.
What's the problem?
Furthermore, why it doesn't allow me to set 512 packets per transfer? It says: Maximum of 4MB per transfer. Packets reduced.
Thank you!
Show LessBy doing my project , I found that it is diffculty to develop a composite video devices. And now the error is puzzle me . I do not why? Can somebody give me some advices??
From te FX3Api.pdf, I found that the cypress support multi-DMA channels , and I choose the multicast mode . and in my project is one producer - two consumer. And I read the sdk sample "usbbulkloopmulticast" and fx3api.pdf. Then I follow the sdk sample to create the multichannel , and I have examined several times , and I think there are no errors, But If I run the application , the log reports that the channel is create fail and the error code is 64, And I check what means about 64, It means that the parameters invalid , but I think all the parameters are right ? Why ?? Can which parameter is error ???
/* Create a DMA Manual OUT channel for streaming data */
/* Video streaming Channel is not active till a stream request is received */
dmaCfg.size = CY_FX_UVC_STREAM_BUF_SIZE; //1024
dmaCfg.validSckCount = 2;
dmaCfg.count = CY_FX_UVC_STREAM_BUF_COUNT; // 8
dmaCfg.prodSckId[0] = CY_U3P_CPU_SOCKET_PROD;
dmaCfg.consSckId[0] = CY_FX_EP_VIDEO_CONS_SOCKET; // (CONS_1 )
dmaCfg.consSckId [1]= CY_FX_EP_VIDEO_CONS_SOCKET_2; // (CONS_3)
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification =0;
dmaCfg.cb = NULL;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaMultiChannelCreate (&glChMultiHandleUVCStream,
CY_U3P_DMA_TYPE_MANUAL_ONE_TO_MANY , &dmaCfg);//CY_U3P_DMA_TYPE_MULTICAST
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaMultiChannelCreate failed, Error code = %d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
Hi!
There are two transfer options in this application:
-Packets per Xfer
-Xfers to Queue
I'm using streaming in firmware with 32 bit.
Can anyone explain to me what are these two options?
What is the best combination to achieve the highest throughput?
Are the transfered packets stored in my ram?
Thank you!
Show LessI am looking for a usb 3.0 controller chip set into which I can dump my data of 8 bit or 16 bit -byte data at 36 Mhz/72 Mhz/144Mhz/ 148.5Mhz, clock speed. In order to be sent to PC's system memory through a USB bus in real time, there should be a good size of internal buffer(memory) of at least 8K Bytes in the USB controller.
Show Lesshello
I am using slavefifo 2bit firmware. The PC program I use streamer.Now I want transfer data from FPGA through FX3 to PC. But I meet a problem .
When I write data to FX3 ceaselessly. Streamer will get no failures. But if I write data to FX3 everytime delay 40us for other device control, I will get a lot of failures at Streamer.
When I usb FX2, the same FPGA program will not get this kind of problem. What's wrong with my design. Is the waitforxfer() function using for speed synchronizing between the PC and the FPGA?
Show LessHi guys, I have errors when I implement two usb videos use the FX3 DVK .
My project is changed from UVC sample in SDK Samples . I have added the descriptors in the USB 3 descriptors, there are 4 interfaces , 2 control interfaces and 2 VS stream interfaces. And now the graphEdit(Win7) can recognize the capture source , and the source filter has two source and two output pin . If the address of the VS Stream EP in interface 1 and 3 is the same, the capture source can be rendered but it can not be closed and reopen !!!
The descriptor is :
/* Standard video streaming interface descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number */
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : CC_VIDEOSTREAMING */
0x00, /* Interface protocol code : Undefined */
0x00, /* Interface descriptor string index */
/* Class-specific video streaming input header descriptor */
0x0F, /* Descriptor size */
0x24, /* Class-specific VS i/f Type */
0x01, /* Descriptotor subtype : input header */
0x02, /* 1 format desciptor follows */ /////////////////format
// 0x19,0x00, /* Total size of class specific VS descr */
0x38,0x00, /* Total size of class specific VS descr */
CY_FX_EP_ISO_VIDEO, /* EP address for ISO video data */
0x00, /* No dynamic format change supported */
0x04, /* Output terminal ID : 4 */
0x01, /* Still image capture method 1 supported */
0x01, /* Hardware trigger supported for still image */
0x00, /* Hardware to initiate still image capture */
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported */
0x00,
/* Standard video streaming interface descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x03, /* Interface number */
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : CC_VIDEOSTREAMING */
0x00, /* Interface protocol code : Undefined */
0x00, /* Interface descriptor string index */
/* Class-specific video streaming input header descriptor */
0x0F, /* Descriptor size */
0x24, /* Class-specific VS i/f Type */
0x01, /* Descriptotor subtype : input header */
0x02, /* 1 format desciptor follows */ /////////////////format
// 0x19,0x00, /* Total size of class specific VS descr */
0x38,0x00, /* Total size of class specific VS descr */
CY_FX_EP_ISO_VIDEO, /* EP address for ISO video data */
0x00, /* No dynamic format change supported */
// 0x04, /* Output terminal ID : 4 */
//change 0912
0x08,
0x01, /* Still image capture method 1 supported */
0x01, /* Hardware trigger supported for still image */
0x00, /* Hardware to initiate still image capture */
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported */
0x00, /* D2 : Compression quality supported */
From those two VS stream interfaces descriptors , you can see the EP address is the same : CY_FX_EP_ISO_VIDEO . But I can not close and reopen the videos ???
Then I changed the EP address , I changed the EP address from CY_FX_EP_ISO_VIDEO to CY_FX_EP_ISO_VIDEO_2 (I define the value is 0x83). Then in the project I think I used the same DMA Channels and same DMA buffers for the 2 EPs, but use 2 values to define whether the EP is active or not (glIsApplnActive and glIsApplnActive2) ,
If the EhP0 is closed , I flush the EP0, and if the EP1 is active, the DMA channel does not destroy. The DMA channel is create when there is a EP open , But the DMA destroy only when the EP0 abd EP1 all close! see the below code:
CyU3PReturnStatus_t
CyFxUVCApplnStart (uint8_t interface)
{
CyU3PEpConfig_t epCfg;
CyU3PDmaChannelConfig_t dmaCfg;
CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;
CyU3PDebugPrint(4, "+++++CyFxUVCApplnStart++++\n");
/*changed by jijun.yu 0913*/
uint8_t epAddr = -1;
if (!glIsApplnActive && (interface == 1))
epAddr = CY_FX_EP_ISO_VIDEO;
else if (!glIsApplnActive2 && (interface == 3))
epAddr = CY_FX_EP_ISO_VIDEO_2;
else
return CY_U3P_SUCCESS;
CyU3PDebugPrint(4, "+++++CyFxUVCApplnStart epAddr = %d++++\n",epAddr);
/* Video streaming endpoint configuration */
epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_ISO;
epCfg.pcktSize = CY_FX_EP_ISO_VIDEO_PKT_SIZE;
epCfg.isoPkts = 1;
epCfg.burstLen = 1;
epCfg.streams = 0;
//changed by jijun.yu 0913
apiRetStatus = CyU3PSetEpConfig(epAddr, &epCfg); //CY_FX_EP_ISO_VIDEO
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error Code = %d\n", apiRetStatus);
return apiRetStatus;
}
/* Create a DMA Manual OUT channel for streaming data */
/* Video streaming Channel is not active till a stream request is received */
dmaCfg.size = CY_FX_UVC_STREAM_BUF_SIZE;
dmaCfg.count = CY_FX_UVC_STREAM_BUF_COUNT;
dmaCfg.prodSckId = CY_U3P_CPU_SOCKET_PROD;
dmaCfg.consSckId = CY_FX_EP_VIDEO_CONS_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.cb = NULL;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
/*changed jijun 0913*/
if ((!glIsApplnActive) && (!glIsApplnActive2)) {
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleUVCStream, CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, error code = %d\n",apiRetStatus);
return apiRetStatus;
}
}
/* Flush the endpoint memory */
CyU3PUsbFlushEp(epAddr);
/////////////??????
if (!glIsApplnActive && !glIsApplnActive2) {
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleUVCStream, 0);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer failed, error code = %d\n", apiRetStatus);
return apiRetStatus;
}
}
/* Update the flag so that the application thread is notified of this. */
if (interface == 1)
glIsApplnActive = CyTrue;
if (interface == 3)
glIsApplnActive2 = CyTrue;
return CY_U3P_SUCCESS;
}
void
CyFxUVCApplnStop (uint8_t interface)
{
CyU3PEpConfig_t epCfg;
uint8_t epAddr = -1;
CyU3PDebugPrint(4, "CyFxUVCApplnStop interface = %d \n",interface);
/* Update the flag so that the application thread is notified of this. */
if (interface ==1) {
epAddr = CY_FX_EP_ISO_VIDEO;
glIsApplnActive = CyFalse;
}
if (interface == 3) {
epAddr = CY_FX_EP_ISO_VIDEO_2;
glIsApplnActive2 = CyFalse;
}
/* Abort and destroy the video streaming channel */
if ((!glIsApplnActive) && (!glIsApplnActive2)) {
CyU3PDebugPrint(4,"Destroy the dma channel \n");
CyU3PDmaChannelDestroy (&glChHandleUVCStream);
}
/* Flush the endpoint memory */
CyU3PUsbFlushEp(epAddr);
/* Disable the video streaming endpoint. */
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof (epCfg));
epCfg.enable = CyFalse;
CyU3PSetEpConfig(epAddr, &epCfg);
}
static void
CyFxUVCApplnUSBEventCB (
CyU3PUsbEventType_t evtype, /* Event type */
uint16_t evdata /* Event data */
)
{
uint8_t interface = 0, altSetting = 0;
if (evtype == CY_U3P_USB_EVENT_SETINTF )
CyU3PDebugPrint(4,"CyFxUVCApplnUSBEventCB evtype = %d \n ",evtype);
switch (evtype)
{
case CY_U3P_USB_EVENT_SETINTF:
/* Start the video streamer application if the
* interface requested was 1. If not, stop the
* streamer. */
interface = CY_U3P_GET_MSB(evdata);
altSetting = CY_U3P_GET_LSB(evdata);
if ((altSetting == CY_FX_UVC_STREAM_INTERFACE) &&
((interface == 1)||(interface == 3)))
{
/* Stop the application before re-starting. */
if (glIsApplnActive||glIsApplnActive2)
{
CyFxUVCApplnStop (interface);
} //else //added 0913
CyFxUVCApplnStart (interface);
break;
}
/* Fall-through. */
case CY_U3P_USB_EVENT_SETCONF:
case CY_U3P_USB_EVENT_RESET:
case CY_U3P_USB_EVENT_DISCONNECT:
/* Stop the video streamer application. */
if (glIsApplnActive||glIsApplnActive2)
{
CyFxUVCApplnStop (interface);
}
break;
default:
break;
}
// CyU3PDebugPrint(4,"CyFxUVCApplnUSBEventCB is ok \n");
}
void
UVCAppThread_Entry (
uint32_t input) {
while (glIsApplnActive||glIsApplnActive2){
.............
}
}
however, after I changed the process, the Ep1 can not be rendered!!! and also can not be reopened ! Can you tell me how two handle the DMA channel and two video devices?? Thanks!!
Show LessHi, we have FX3 board which already has a programmed SPI EEPROM, and every time when the device plug on to host, the device take a SPI boot and the firmware on SPI compeletely takes control of the device , which gives us a firmware vid pid, descriptors etc.
Now I have a question here, how can we reprogramm SPI EEPROM on this device without hardware changing involved ( such as cut wire/reconfig pin connection), it apparently does not support Cypress FX3 vendor specific command for the new firmware download ( or erase). Any idea?
Thanks,
Henry
Show Less