USB superspeed peripherals Forum Discussions
Hi,
I wanted to Flash the Fx3 Firmware First in RAM. And than write into the SPI Flash.
Basically ,I wants when Firmware in SPI Flash is get corrupted by any reason. I Flash the RAM after using the RAM Firmware write it into SPI Flash.
So how to do that without converting HW bootloader Mode.??
Show Less
We are using CYUSB2304-68LTXI in our instrument. We have both USB Full speed and High Speed devices on the same hub. On power up the USB Full speed devices are detected correctly but the USB High Speed devices are not identified correctly.
There are 4 Hubs in total in the system. 10 instruments connected in total. Combination of both full speed and high speed devices.
Can you please shed some light why is the High speed device enumeration not happening.
Show LessI'm writing USB 2.0 OTG UVC host firmware on FX3 and usb 2.0 web cam is used as device.
The traffics generated between PC and web cam were captured by the Lecroy USB analyzer. (attached "pc_captured.usb")
I mimicked the traffics captured above in my UVC host firmware and those were captured in "fw_captured.usb"
The following shows the traffics around the time when SET_INTERFACE (Transfer 168) is called.
Unfortunately, after the 12 bytes of isochronous data from the web cam (Transfer 169), no more data from the device could be found.
"fw_captured.usb"
The following picture shows the traffic captured between PC and web cam.
Definitely we can clearly see data is coming continuously. (Transfer 202)
"pc_captured.usb"
Some relevant code snippets used in my host fimware are shown below,
UvcRecvThread is designed to receive data from web cam.
void UvcRecvThread( uint32_t Value) {
uint8_t buffer[1024*4];
uint16_t count = 1024;
...
for (;;)
{
buf_p.buffer = buffer;
buf_p.count = 0;
buf_p.size = ((count + 0x0F) & ~0x0F);
buf_p.status = 0;
status = CyU3PDmaChannelSetupRecvBuffer (&glHostUvcCh, &buf_p);
status = CyU3PUsbHostEpSetXfer (glHostUvcEp,CY_U3P_USB_HOST_EPXFER_NORMAL, count);
status = CyU3PUsbHostEpWaitForCompletion (glHostUvcEp, &epStatus, CYU3P_WAIT_FOREVER);
status = CyU3PDmaChannelWaitForCompletion (&glHostUvcCh, CYU3P_NO_WAIT);
status = CyU3PDmaChannelGetStatus (&glHostUvcCh, &state, &prodXferCount, &consXferCount);
}
}
End point and DMA channel setup were done as below
/* Initialize the UVC */
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof(epCfg));
epCfg.type = CY_U3P_USB_EP_ISO;
epCfg.mult = 1;
epCfg.maxPktSize = size;
epCfg.pollingRate = 0;
size = ((size + 0x0F) & ~0x0F);
epCfg.fullPktSize = size;
epCfg.isStreamMode = CyFalse;
status = CyU3PUsbHostEpAdd (glHostUvcEp, &epCfg);
/* Create a DMA channel for this EP. */
CyU3PMemSet ((uint8_t *)&dmaCfg, 0, sizeof(dmaCfg));
dmaCfg.size = size;
dmaCfg.count = 0;
dmaCfg.prodSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_PROD_0 + (0x0F & glHostUvcEp));
dmaCfg.consSckId = CY_U3P_CPU_SOCKET_CONS;
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;
status = CyU3PDmaChannelCreate (&glHostUvcCh, CY_U3P_DMA_TYPE_MANUAL_IN, &dmaCfg);
Why I couldn't receive more data after receiving 12 bytes of data from web cam?
Regards,
Rossi
Show LessHello,
While receiving data from UVC camera in my USB 2.0 host firmware, ocasionally 0x53(CY_U3P_ERROR_STALLED) errors were found after CyU3PUsbHostEpWaitForCompletion call. (Full log is attached)
...
CyU3PUsbHostEpSetXfer status=0x0,count=1024
CyU3PUsbHostEpWaitForCompletion...
CyU3PUsbHostEpWaitForCompletion status=0x53,ep=0x81,epStatus=0x34C4141
CyU3PDmaChannelWaitForCompletion...
CyU3PDmaChannelWaitForCompletion status=0x0
...
My endpoint setup is shown below
size = 1024;
/* Initialize the UVC */
CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof(epCfg));
epCfg.type = CY_U3P_USB_EP_ISO;
epCfg.mult = 3;
epCfg.maxPktSize = size;
epCfg.pollingRate = 0;
size = ((size + 0x0F) & ~0x0F);
epCfg.fullPktSize = size;
epCfg.isStreamMode = CyFalse;
The UVC webcam data receivinng thread is as below.
void
UvcRecvThread(
uint32_t Value)
{
...
for (;;)
{
buf_p.buffer = buffer;
buf_p.count = 0;
buf_p.size = ((count + 0x0F) & ~0x0F);
buf_p.status = 0;
CyU3PDebugPrint(4,"CyU3PDmaChannelSetupRecvBuffer...\r\n");
status = CyU3PDmaChannelSetupRecvBuffer (&glHostUvcCh, &buf_p);
CyU3PDebugPrint(4,"CyU3PDmaChannelSetupRecvBuffer status=0x%x,size=%d\r\n",status,buf_p.size);
if(status!=CY_U3P_SUCCESS) continue;
CyU3PDebugPrint(4,"CyU3PUsbHostEpSetXfer(%d)...\r\n",count);
status = CyU3PUsbHostEpSetXfer (glHostUvcEp,CY_U3P_USB_HOST_EPXFER_NORMAL, count);
CyU3PDebugPrint(4,"CyU3PUsbHostEpSetXfer status=0x%x,count=%d\r\n",status,count);
if(status!=CY_U3P_SUCCESS) continue;
CyU3PDebugPrint(4,"CyU3PUsbHostEpWaitForCompletion...\r\n");
status = CyU3PUsbHostEpWaitForCompletion (glHostUvcEp, &epStatus, 10);
CyU3PDebugPrint(4,"CyU3PUsbHostEpWaitForCompletion status=0x%x,ep=0x%x,epStatus=0x%x\r\n",status,glHostUvcEp,epStatus);
CyU3PDebugPrint(4,"CyU3PDmaChannelWaitForCompletion...\r\n");
status = CyU3PDmaChannelWaitForCompletion (&glHostUvcCh, CYU3P_NO_WAIT);
CyU3PDebugPrint(4,"CyU3PDmaChannelWaitForCompletion status=0x%x\r\n",status);
if(status!=CY_U3P_SUCCESS) continue;
status = CyU3PDmaChannelGetStatus (&glHostUvcCh, &state, &prodXferCount, &consXferCount);
CyU3PDebugPrint (4,"CyU3PDmaChannelGetStatus status=0x%x state=0x%x length=%d\r\n",status,state,prodXferCount);
for(uint32_t i=0;i<prodXferCount-1;i++) {
if(buffer[i]==0xff && buffer[i+1]==0xd8) CyU3PDebugPrint(4, "SOI=====================\r\n");
if(buffer[i]==0xff && buffer[i+1]==0xd9) CyU3PDebugPrint(4, "EOI---------------------\r\n");
}
}
}
In the above log, I think this following is very ominous one.
CyU3PUsbHostEpWaitForCompletion status=0x53,ep=0x81,epStatus=0x34C4141
But lack of information, it is hard for me to figure out what it tells exactly.
According to this article, I could extract some information as below
0x4141 = b(0100 0001 0100 0001)
Name | Value | Description |
EP_NUM | 1 | Endpoint number |
Direction | 0 | IN |
Active | 0 | EP got deactivated |
Halt | 1 | EP is halted |
Overrun/Underrun | 0 |
No overrun/underrun condition |
Babble | 1 |
Babble was detected |
XactErr | 0 |
|
Ping | 0 |
No ping token has been issued |
Byte Count | 0x34C (844) |
Total byte count left |
I think that STALL error(0x53) is related with the above epStatus, especially babble and halt. But I have no idea how can I explain the above test result. I expect that maybe the endpoint setup is not matched with the camera. (not for sure)
It would be great if I can understand the meaning of those parameters better.
I believe that understanding will lead me to a solution on this issue.
Regards,
Rossi
Show LessHi,
I am using a CX3 Dev Kit to interface to an Omnivision OCSHA10 image sensor. I am debugging the quality of the image received from the sensor. Which CX3 API can I use to get the frame buffer so that I can check the content of each frame?
Thanks for your help.
Regards,
Subramanyan
Show LessHello,
I setup fx3 superspeed kit with FPGA board to test streamOUT example provided. Streamer and loopback functions well. I can transmit data and receive back. I am trying to transmit 302700 bytes of data or 302700/4=76800 counts of 32 bits. It seems to stop at counter 3072. Counter goes from 76800 to 0 (76799 to 0 to be exact). I am using 32 bits width bus. So each count is 32 bits. So 294912 bytes of data seems to be transmitted just normal, until it stops abnormally. Is there any maximum size limit on Control Center software?
It has a burst size of 4096*4=16384 bytes per transfer. Since 76800-72704 = 4096 and data stops and starts again. It seems to work just fine, between bursts, until it hits 3072 count, where FX3 control center side seems to do nothing.
Show LessHi everyone!
I have a product with an FPGA connected with a Cypress CYUSB3011 using a GPIF 16bits. The FPGA code is based on AN65974 and the firmware of the Cypress is based on the Slave fifo example. The problem happens when I try to send a lot of data through the USB connection coming from the FPGA. We have a lot of information to send, from a camera, adc and other peripherals so the bandwidth needed should be around 600Mbits/sec so inside the USB connection speed.
The packets sent from the FPGA are 8192 bytes long in between end packet. The packets are always 8192 bytes or are padded so they are. If I don't pad the packet, I discovered that the bulking of packets didn't work at all and speed were really limited. I also have a timeout of 5ms in between packet so information is always flowing even when in between two frame of the camera.
The problem is this: On my computer everything works perfectly, every packet is coming through. But on other computers, for a reason I don't understand the flags of the cypress doesn't allow to send the information as fast as on my computer and the fifos in the FPGA get full and I lose some data. As if the cypress wasn't able to send the data quick enough and the buffer were full. Everything is identical: same board, same cable, same fpga, same cypress, same firmware, same driver, even same usb3 chipset but there is still a difference between the two computer.
One thing I have seen is in wireshark. On the working computer, all packet are the same size: 524315bytes. The bulk seem to have worked. But on the non working computers, most of the packet are 524315bytes but some coming from the device are not as if the bulk didn't work. They are sometimes 80% the full size sometimes 10%.
If anyone needs more information I will be happy to give it to you!
Please help me!
Étienne Drouin
Show LessHello,
I'm using CYUSB306X IC with deserializer (MAX9296) and serializer (MAX9295) structure. I can take stream without SerDes, with AS0149 MIPI board but I can't take stream with Serdes.
Host PC could recognize CX3 as a video device but it's black screen. I've configured deserializer, serializer and image sensor on a Linux machine so I'm sure about configuration.
No error are reporting on serial console.
Is there any application note or suggestions about this configuration?
BR.
Show Less
Hi
Now, i capture the total 65536 points of ad data in fpga fifo, and use a wire flag to indicate the fpga fifo is full(the flag state is 1, and the wire flag is connected to the GPIO42), while the CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U is 8, and the BURST_LEN is 16(the p to u point byte size is 16*1024), so once the fpga fifo is full, the send state machine gets work to send the ad date to the usb p to u bffer. The full flag is not to bocome 0 automatically until the send state machine judges the fpga fifo is empty.
In VS2015, i send a vnedor command to read the GPIO42 state in cycle to indicate there are enough data in usb p to u bffer, avoiding the reading operation of BeginDataXfer make mistake. Now, the situation is that, before i send a vnedor command to read the GPIO42 state, the full flag has become 0, so in VS2015, i do not detect the GPIO42 state is 1(the full flag is 1).
I try a way to solve the problem, the full flag keeps 1 once the fpga fifo is full, and i use a posedge pulse of GPIO38 to reset the full flag after the FinishDataXfer, but this operation takes time. I try another way like use "CyU3PGpioSetValue (38, CyTrue) CyU3PGpioSetValue (38, CyFalse)" in the end of CyFxSlFifoPtoUDmaCallback of firmware, but it does not work.
I wonder is there a another way to reset the full flag in firmware?
Show LessDear Sir/Madam,
Our customer engineers is using USBBulkSourceSink Example to test and get the UART debug log to acquire the error code to analyzer issues when attempting to establish USB SS communication.
We found that some of the reported error/event code are not listed from CYU3USB.H and cyfx3api.h such as 8x 9x
Would you kindly advise the complete Debug Print list of event and log in FX3 SDK for further debugging?
Thanks and Regards,
Kevin
Customer captured log as follows: seems the USB SS Phy keep retrying and reset:
Uart Init Ok!!
debug initialized
USB EVENT: 11 0
About to connect to USB host
USB EVENT: 0 1
CyFxBulkSrcSinkApplnInit complete
USB LOG: 6
USB LOG: 88
USB LOG: 12
USB LOG: 89
USB LOG: 8A
USB LOG: 98
USB LOG: 4
USB LOG: 5
USB LOG: 24
USB LOG: 40
USB LOG: 41
USB LOG: 42
USB EVENT: 2 0
USB EVENT: 0 0
USB EVENT: 4 0
USB EVENT: 6 1
USB EVENT: 24 0
USB EVENT: 0 1
USB LOG: 51
USB LOG: 88
USB LOG: 12
USB LOG: 89
USB LOG: 8A
USB LOG: 8C
USB LOG: 80
USB LOG: 81
USB LOG: 11
USB LOG: 88
USB LOG: 89
USB LOG: 8A
USB LOG: 98
USB LOG: 9A
USB LOG: 4
USB LOG: 5
USB LOG: 24
USB LOG: 40
USB LOG: 41
USB LOG: 42
USB EVENT: 2 0
USB EVENT: 4 0
USB EVENT: 6 1
USB EVENT: 24 0
USB EVENT: 0 1
USB LOG: 51
USB LOG: 88
USB LOG: 12
USB LOG: 89
USB EVENT: 24 0
USB EVENT: 2 0
USB LOG: 8A
USB LOG: 98
USB LOG: 90
USB LOG: AC
USB LOG: 98
USB LOG: 4
USB LOG: 5
USB LOG: 24
USB LOG: 40
USB EVENT: 4 0
USB EVENT: 0 1