Announcements

Register now for the most anticipated Asia Pacific Power Seminar 2022

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

USB superspeed peripherals Forum Discussions

AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

Hi, I am working on interfacing ov7670 with CYUSB3KIT-003 as per this blog:

https://www.circuitvalley.com/2019/12/diy-cypress-fx3-usb3-usb-3-uvc-camera-ov7670.html?showComment=...

Checked all the signals like PCLK,HREF,VSYNC,XCLK, all looks fine. firmware loaded to FX-3 but failed to display anything on vlc/webcamoid application. Here s the frame/buffer log...

Please help to resolve this issue. What more I should figure out.

 
 

Ash_2-1639380286325.png

Best Regards,

/Ash

 

0 Likes
1 Solution
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar @JayakrishnaT_76 @Ajeethkumar  Thank you all for your suggestions and guidance.

I figured it out and I can see the data streaming is there. But I did not understand why it takes VGA(640x483) (even not mentioned in attached DS) instead of VGA(640x480). when I apply 480 there is nothing comes up on host application.

Also, how can I cross check the total number of bytes from sensor to send to host? since there are lot of data is coming on wireshark log through USBCap, where and how can I cross check the 1 frame data? any way to check.....

Please suggest~

Best Regards,

/Ash

View solution in original post

0 Likes
58 Replies
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

From the UART debug prints, it looks like there are commit buffer failures happening. Could you check the return status of the MultiChannelCommitBuffer API. Note that, it is not recommended to use debugPrints inside a callback function. So you could try either setting an event or assigning the return status to another variable and printing that variable in the infinite for loop.

Is the AN75779 default firmware being used without any modifications?

Could you share the wireshark traces?

Is the host application fast enough to read all the data being sent from FX3.

You could also refer to the Troubleshooting section in the AN75779 Application note.
https://www.infineon.com/dgdl/Infineon-AN75779_How_to_Implement_an_Image_Sensor_Interface_with_EZ-US...

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Thanks for your prompt reply.

I checked that and here is the log....

Ash_0-1639389532458.png

 

host is my Desktop PC (win10) with vlc application running on it.

I followed this: https://github.com/circuitvalley/Cypress-FX3-USB3

Please suggest~

Best Regards,

/Ash

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Could you answer the remaining questions I have asked in my previous post?

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  please find the answers below. Thanks.

  1. From the UART debug prints, it looks like there are commit buffer failures happening. Could you check the return status of the MultiChannelCommitBuffer API. Note that, it is not recommended to use debugPrints inside a callback function. So you could try either setting an event or assigning the return status to another variable and printing that variable in the infinite for loop.

Ash_0-1639448856139.png

2. Is the AN75779 default firmware being used without any modifications?

3. Could you share the wireshark traces?

  • please check attached file.
    Ash_1-1639449405167.png

4. Is the host application fast enough to read all the data being sent from FX3.

  • yes seems.

5. You could also refer to the Troubleshooting section in the AN75779 Application note.
https://www.infineon.com/dgdl/Infineon-AN75779_How_to_Implement_an_Image_Sensor_Interface_with_EZ-US...

  • I will check it. Please let me know what I need to cross check from here.
0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi,

Can you please check (probe) the signals, FV, LV and data lines at the FX3 side, as we suspect that there is no data coming from the image sensor module.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  seems, its coming up.

Ash_0-1639465700155.png

 

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  any suggestions please?

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Are the lines probed near the FX3 side?

Could you also probe the PCLK line near the FX3?

If possible, please send the photo of the camera and FX3 interface setup.

Try using the CyU3PGpifGetSMState(..) API in the infinite for loop and print the output using debugprints and kindly share with us the results.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  PCLK, HREF, VSYNCsignals at FX3

Ash_0-1639538330310.png

Ash_1-1639538403217.png

I have used 'CyU3PGpioSetValue(), CyU3PGpioInit() under CyU3PGpioSimpleConfig_t().

I didn't understand this. suddenly it showing something in buffers like......

Ash_2-1639540652556.png

but still there is nothing on display screen (vlc) at host. Please suggest~

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Could you use the cyfxgpif2config.h file inside the attached folder instead of the one given in the link you had pointed us to.

Also it is recommended to download the firmware from AN75779 and kindly refer to the document of AN75779 on instructions and details related to the UVC camera application with FX3.
https://www.infineon.com/dgdl/Infineon-AN75779_How_to_Implement_an_Image_Sensor_Interface_with_EZ-US....

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Thanks fro your suggestion. I replaced the "cyfxgpif2config.h" with the old, i am using. I found that its the same file, there is no change in mine (old one). but anyway, I tested it with the new "cyfxgpif2config.h"(you shared) and result is like....

Ash_0-1639621096858.png

Ash_1-1639622746580.png

 

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Could you please try the firmware coming with AN75779, pointed in the previous post. It is a tried and tested firmware. This will help us to narrow down the issue, if the issue still persists even after using this firmware.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar hello. yes I am trying that. please check the below log and suggest~

Ash_0-1639715215004.png

Thanks.

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi. Please suggest some. Thanks.

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Please refer to the following KBA : https://community.infineon.com/t5/Knowledge-Base-Articles/FX3-Error-in-CyU3PDmaMultiChannelCommitBuf...

Also try using different host applications.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Thanks. I already going through it but not sure which method I need to implement and test.....

Could you please share any working example code which refers the VGA camera (30fps) interface to FX3.? would be helpful to debug....

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar 

The KBA mention this: " This error does not occur in FX3 SDK versions 1.3.5 and later, and if CyU3PDmaMultiChannelGetBuffer()succeeds before CyU3PDmaMultiChannelCommitBuffer() is called."

Do you have any link to download FX3 SDK v1.3.5?

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

I have attached a working and tested example code for VGA resolution with 30fps in USB 3 link. I have added the required debugPrints for a better debug.

Kindly use the attached firmware and please do send the UART debug prints if the issue persists.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  Thank you for sharing this. 
I tested this. this only included image file. here is the UART log..

Ash_0-1640069259605.png

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar , what are the changes I need to do if I connected to USB2.0 (HS). seems, FX3 detects the connected USB as "Detected HS USB Connection". Please suggest~

@AliAsgar Also, it shows the Error: Reading Sensor ID failed! 

Ash_0-1640169487925.png

Did you use the 0v7670 configuration? like.....

/* I2C Slave address for the image sensor. */
#ifdef SADDR_HIGH
#define SENSOR_ADDR_WR 0xBA             /* Slave address used to write sensor registers. */
#define SENSOR_ADDR_RD 0xBB             /* Slave address used to read from sensor registers. */
#else
#define SENSOR_ADDR_WR 0x42             /* Slave address used to write sensor registers. */
#define SENSOR_ADDR_RD 0x43             /* Slave address used to read from sensor registers. */
#endif

#define I2C_SLAVEADDR_MASK 0xFE         /* Mask to get actual I2C slave address value without direction bit. */

#define I2C_MEMORY_ADDR_WR 0xA0         /* I2C slave address used to write to an EEPROM. */
#define I2C_MEMORY_ADDR_RD 0xA1         /* I2C slave address used to read from an EEPROM. */
0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash, 

I had tested the VGA resolution 30fps with a different camera, not the the OV7670.
I have attached the firmware project folder. Modify the sensor.c and sensor.h files according to your sensor, build the project in eclipse and try to program the FX3 with the firmware image obtained.

If the issue still persists, could you please send us a photo of how the camera is connected to FX3, where each connection is seen clearly.
Please let us know the bus width of GPIF interface used?

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Thank you. I will check it and update sensor.c and sensor.h as per the ov7670 configuration.

I will share the requested details and log. May I know which sensor module (with VGA, 30fps) you have tested with FX3?

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Please check the below config and log.

Ash_0-1640228406583.png

Ash_1-1640228586590.png

 

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

I had worked with the MT9M114 Onsemi image sensor. By photo I meant the actual FX3 and image sensor connection photo.

Are the UART prints taken after modification of the sensor.c and sensor.h files? What modifications were done?

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar . Okay. Please refer the attached files.

yes the UART log is after modifying sensor.c/sensor.h files.

Also, while debugging I found that "request to start video stream' doesn't call, means the check condition is not true here, so it doesn't go inside to srart the ApplinStart().Ash_0-1640241851447.png

flag get set to 32 and  #define CY_FX_UVC_STREAM_EVENT (1 << 0).

Please suggest!

Best Regards,

/Ash

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi.

It enters into the streaming "application start " when I run the host application. but this gives me log with "0 buffers".

Ash_0-1640245873423.png

what should the Full Buf contains..?

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi, Please suggest what to check more.

Best Regards,

/Ash

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar  Hi,

Do I need to reconsider this below definitions again? Please suggest~

/* UVC Video Streaming Endpoint Packet Size */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE    (0x400)    /* 1024 Bytes */

/* UVC Video Streaming Endpoint Packet Count */
#define CY_FX_EP_BULK_VIDEO_PKTS_COUNT  (0x10)          /* 16 packets (burst of 16) per DMA buffer. */

/* DMA buffer size used for video streaming. */
#define CY_FX_UVC_STREAM_BUF_SIZE       (CY_FX_EP_BULK_VIDEO_PKTS_COUNT * CY_FX_EP_BULK_VIDEO_PKT_SIZE)  /* 16 KB */

/* Maximum video data that can be accommodated in one DMA buffer. */
#define CY_FX_UVC_BUF_FULL_SIZE         (CY_FX_UVC_STREAM_BUF_SIZE - 16)

/* Number of DMA buffers per GPIF DMA thread. */
#define CY_FX_UVC_STREAM_BUF_COUNT      (4)

 

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi, hope you have checked the attached contents in my previous replies. Please suggest, I stuck here.

Best Regards,

/Ash

0 Likes
Ajeethkumar
Moderator
Moderator 10 likes given 100 replies posted 100 sign-ins
Moderator

Hi Ash,

What host application you are using to capturing the data from FX3?

 

Regards,

Ajeeth

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@Ajeethkumar 
I am trying with vlc/Amcap/VirtualDub.

Please suggest~

Best Regards,

/Ash

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar @Ajeethkumar  Please suggest some way to resolve this.

Best Regards,

/Ash

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Inside MultiChannelGetBuffer API in the prod Event of the DMA callback, assign the value of the dmaBuffer.count to a variable and print this variable along with number of frames and number of buffers. This will give us an idea of how much data is being transmitted to FX3 in each buffer. 

Full buffer in this case should be of 16 KB - 16.

Best Regards,
AliAsgar 

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi, Thanks a lot for being connected....

here is the requested result. please check.

Ash_0-1640855002494.png

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Please share your uvc.c file with me.

Best Regards,
AliAsgar

 

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Please find the attached file.

Thanks.

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar Hi,

After comment out  "DEBUG_PRINT_FRAME_COUNT", it shows the below log with Full Buf, Partial Buf, Cons Events....

Ash_0-1640855808943.png

0 Likes
AliAsgar
Moderator
Moderator 50 likes received 500 replies posted 250 replies posted
Moderator

Hi Ash,

Do you get the video data when "DEBUG_PRINT_FRAME_COUNT" is commented out?
If there is no video data coming, share with me the Wireshark traces.

Best Regards,
AliAsgar

0 Likes
AKS
Level 4
10 questions asked 50 replies posted 50 sign-ins
Level 4

@AliAsgar This is the log with comment out  /* "DEBUG_PRINT_FRAME_COUNT" */ 

please refer the attached wireshark traces. Thanks.

Ash_0-1640856906020.png

0 Likes