I'm using CYUSB3KIT-003 uvc project with ov5640. GPIF II interface shows in 'gpif.png' and its state machine unchanged.
ov5640 i2c probe and initializing was copy from my old CY7C68013A project which works ok. The wave shows in 'ov5640.png'.
I got wrong wave using the same i2c registers config (see SensorInit.txt from my code).
I2C config ov5640 to stream raw 640x480 bayer. Usb descriptor (cyfxuvcdscr.c) show in 'usb.txt'.
But I see black image using windows camera application.
I capture usb commucation with wireshark show all 0xFF values in 16kb transfermation (shows in 'cap.png' and 'uartlog.txt').
According to "001-92220_AN75779_How_to_Implement_an_Image_Sensor_Interface_with_EZ-USB_FX3_in_a_USB_Video_Class_UVC_Framework_Chinese.pdf",
My cmos sensor is 8bit width, so LD_DATA_COUNT and LD_ADDR_COUNT in GPIF II state machine is set to 16367. (=16368/(8/8)-1). Is this right?
Please help me to find out what is missing or mistaken.
Another thing puzzle me is that why the uvc project can't transfer raw data captured from gpif ports to usb host directly, even the image is broken.
I think if raw data comes to my application, I can debug that without troubling by the fx3.
I notice in your /* Class specific Uncompressed VS frame descriptor */ that the /* Width in pixel 640 */ is coded as 0x02, 0x80. can you change it to 0x80, 0x02 and test?
Thanks for your reply. I'll fix uvc descriptor and try.
Another thing I found using logic viewer is that my PCLK seems confusion. The I2C config code works well on CY7C68013A. It run about four times faster on FX3, but looks ok.
0x80, 0x02 is 640. I fix the mistake. I set gpif 'clock setting' to 'external' the PCLK look like good. Every HREF activation has 640 PCLK rise.
I still can't get image. I add the following code in uvc.c / CyFxUvcApplnDmaCallback after CyFxUVCAddHeader called.
CyU3PDebugPrint (4, "%x %x %x %x %x %x %x %x \r\n", buffer_p1,buffer_p1,buffer_p1,buffer_p1,
It prints some FF and stops running. And if I modify buffer_p1, the usb capture shows what I have modified.
So, the 'usb side' seems ok, but the gpif (or dma) side.
Please help me in the GPIF state machine setting.
Please do not place DebugPrint in dma callback.
You mentioned that USB side is okay. Did you check if the FV, LV and PLCK waveform is okay?
In UART debug prints are you getting any error messages now?
Verify whether you are getting correct number of full DMA buffers (along with one partial buffer) for one frame of data.
If the issue still persists, please post the schematic part showing the interface between FX3 and Image sensor.
And probe the data line and check whether you are getting 0xFF/non-0xFF data.