CX3+ov5640 the example project does not work

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

cross mob
lock attach
Attachments are accessible only for community members.
NickNick
Level 3
Level 3
First solution authored 25 sign-ins 25 replies posted

Hi.

If you build an example project in EZ USB Suite (attached), then everything works. But if I open the configurator and (without changing anything) resave four .C- file that can be resaved, then the project stops working. What could be the problem? EZ USB Suite is the latest. Nothing is issued to the COM port. I work with the CX3 debugging board.

0 Likes
1 Solution

Hi, the problem was in the following code,-

/* Setup Image Sensor */
/*
#ifndef FX3_STREAMING
CyU3PMipicsiSetSensorControl (CY_U3P_CSI_IO_XRES, CyTrue);
CyU3PMipicsiSetSensorControl (CY_U3P_CSI_IO_XSHUTDOWN, CyTrue);
#else
// Configure and Set Image Sensor Reset GPIO
status = CyU3PDeviceGpioOverride (22, CyTrue);
if (status != 0)
{

CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",
status);

}

// Configure GPIO 22 as output; Used as Reset for Sensor
gpioConfig.outValue = CyTrue;
gpioConfig.inputEn = CyFalse;
gpioConfig.driveLowEn = CyTrue;
gpioConfig.driveHighEn = CyTrue;
gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
status = CyU3PGpioSetSimpleConfig(22, &gpioConfig);
if (status != CY_U3P_SUCCESS)
{

CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",
status);

}

#endif
*/

 

Now I have the following question - why is the default camera resolution 640x480?,

how to make the camera transmit 2592x1944?

View solution in original post

0 Likes
29 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Could you elaborate more on what is the issue faced? 

Can you add a debug print at the end of the debugInit function and check if anything is getting printed on the COM terminal?

Saving the files in the Configuration utility overwrites the code files already present.

Best Regards,
AliAsgar

0 Likes

Hi, COM terminal outputs the following:

В1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
AppInit:GpifSMStart passed
bRType = 0x21, bRequest = 0x1, wValue = 0x200, wIndex = 0x1, wLength= 0x22
USB Setup CB:Call AppSTOP1
AplnStop:SMState = 0x2
AplnStrt:SMState = 0x2

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

The .img file you shared with me is working fine.

The debug prints which you shared are proper and do not show any error.

Could you please explain what the issue is? I am not able to understand that.
Is it a programming issue or enumeration issue or streaming issue. Please explain in detail.

Please change your desktop language to English (if not already set) and check again.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

My desktop language is English. When I open the configuration utility and save 4 files (without changing anything in the configuration), I get this project (attached). He gives the Classic Media player just a black picture (I regard this as a problem).

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I tested with the .img file you shared at my end. I was successfully able to stream video. Could you let me know if a custom board is being used or the CX3 Denebola kit is used?

Are there any other debugPrints being seen on the terminal, apart from the ones you shared previously.
Also please share with us the wireshark traces when the black screen is seen.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.
21, bRequest = 0x1, wValue = 0x200, wIndex = 0x1, wLength= 0x22
AplnStrt:SMState = 0x2
bRType = 0x21, bRequest = 0x1, wValue = 0x200, wIndex = 0x1, wLength= 0x22
USB Setup CB:Call AppSTOP1
AplnStop:SMState = 0x2
AplnStrt:SMState = 0x2
 
UБ• = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x100, wLength= 0x0
StpCB:In SET_FTR 0::1
AppInit:GpifSMStart passed= 0x8
bRType = 0x1, bRequest = 0x3, wValue = 0x0, wIndex = 0x0, wLength= 0x0
StpCB:In SET_FTR 0::1
bRType = 0xA1, bRequest = 0x81, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0x21, bRequest = 0x1, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x81, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x83, wValue = 0x100, wIndex = 0x1, wLength= 0x22
bRType = 0xA1, bRequest = 0x82, wValue = 0x100, wIndex = 0x1, wLength= 0x22
 
 
Hi,
Output to the terminal above. The photo of the board, the Wireshark log and the .img image that I use is attached.

 

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

tell me, does the attached image .img work correctly?

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Even the latest .img file you shared is working fine with me.

From the board photo I see that, wires are soldered onto the MDP0 and MDN0 lines. Could you let me know if the issue is seen even after desoldering those wires.

As all the .img files you shared with me is working fine at my end, the issue at your end should be related to your hardware.

Best Regards,
AliAsgar

0 Likes

Hi, please tell me what system configuration you have (operating system and video player)? on which the image works correctly.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I am working on a Windows 10 Operating system and the video player is the Windows In box  camera.

Could you let me know if the issue is seen even after desoldering the debug wires from the MIPI lanes?

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hello, nothing changes from whether there are wires or not. As before, if the three files are
cycx3_uv.c,
cycx3_uvcdscr.c,
cycx3_uvc.h
in the project to use the old ones, then everything works. If re-generated, then the screen is black. I attached the working files.

0 Likes

Hello, nothing special should be written in the EEPROM on the board?, for normal operation.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Nothing special needs to be written to EEPROM.

Could you let us know the boot mode used in your present application?

Please share with us the old firmware project (working) and new firmware project (not working).

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi, I usually use RAM downloads. I attached two projects (working and not working).

 

0 Likes
lock attach
Attachments are accessible only for community members.
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Please find attached zip folder, where I didnt change the configuration and resaved the 4.c files. Could you please check with it at your end? I am still able to stream properly. Same is the case with both the working and non working folder shared by you.

Could please probe the I2C lines and check if the image sensor has been configured correctly in the non-working firmware?

Best Regards,
AliAsgar

0 Likes

Hi, the problem was in the following code,-

/* Setup Image Sensor */
/*
#ifndef FX3_STREAMING
CyU3PMipicsiSetSensorControl (CY_U3P_CSI_IO_XRES, CyTrue);
CyU3PMipicsiSetSensorControl (CY_U3P_CSI_IO_XSHUTDOWN, CyTrue);
#else
// Configure and Set Image Sensor Reset GPIO
status = CyU3PDeviceGpioOverride (22, CyTrue);
if (status != 0)
{

CyU3PDebugPrint (4, "CyU3PDeviceGpioOverride failed, error code = %d\n",
status);

}

// Configure GPIO 22 as output; Used as Reset for Sensor
gpioConfig.outValue = CyTrue;
gpioConfig.inputEn = CyFalse;
gpioConfig.driveLowEn = CyTrue;
gpioConfig.driveHighEn = CyTrue;
gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
status = CyU3PGpioSetSimpleConfig(22, &gpioConfig);
if (status != CY_U3P_SUCCESS)
{

CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",
status);

}

#endif
*/

 

Now I have the following question - why is the default camera resolution 640x480?,

how to make the camera transmit 2592x1944?

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

AliAsgar_0-1678962180984.png

Change the resolution using the host app to stream 2592 x 1944.
For the Windows inbox camera app, change the photo quality to 5MP.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi, with the frame resolution I got it. The next question is, I no longer have access to editing parameters ..., why?, I can't fix more than one digit in the configurator.  

ezUsbSuite reinstalled a few times. I attached a picture.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

You cannot change the values in the CX3 Configuration utility for the default CX3 OV5640 firmware project as the registers written for OV5640 in the library is based on the values populated in the utility.
Only the fields in the CX3 MIPI interface configuration can be changed.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi, I made it so that the sensor sends frames to the PC, but all frames are the same and consist of the same bytes. What do you think about this? The frame is attached.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Could you share the Wireshark traces when the streaming is taking place? Also check the interface timing signals near the FX3 GPIF II lines.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi, I'm clarifying that this is a picture (in the previous post) from my OG02B target sensor (1300x1600, 30fps). OV5640 is working fine. The Wireshark log is attached. Specify which FX3 GPIF II lines you need to look at?, you can use the example of the Benebola board scheme.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Can you share the photo of the setup with CX3 and the image sensor?

Could you also share the OG02B firmware project folder with us ? Also let us know the number of MIPI lanes output of the sensor and the video format supported.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

I have a sensor setup set for the configuration "cyov5640reg_t OG02B10_MIPI_2Lane_RAW10_10b_1600x1300_60fps", but if I understand correctly, it cannot accept 60fps at this resolution, so I lower the fps to 30(I lower the sensor settings // {0x380c,0x03}, // {0x380d,0xa8}, {0x380c, 0x07}, {0x380d, 0x50},). And I get a picture of the same color on a PC. The project and photo of the installation attached.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I see the imager is directly exposed without any lens or optics in between. This may be a reason you only see one colour (pink) on the host PC. Try to add a lens and check if you are able to view a proper video.

Best Regards,
AliAsgar

0 Likes

Hi, you're right. I added a lens and got a picture. It's amazing.

Tell me, are there any instructions on how to change the exposure time? I understand how to do this in the sensor, but how to throw the time data via USB?

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

An extension unit can be added to the UVC interface to communicate with the camera using custom requests. Please find details on extension unit in the given link:

https://community.infineon.com/t5/Knowledge-Base-Articles/FX3-CX3-UVC-Extension-Unit-Application-KBA...

In the setup callback of the firmware, these requests have to be handled appropriately (register settings in camera to change exposure time).

Best Regards,
AliAsgar

0 Likes

Hi.,
tell me, is there a standard way to receive RAW data from the CX3 on the PC side? Or do you always need to apply CyUSB.dll ? I can't find ready-made examples. Working with the PyUSB library was not successful. But MEDIA PLAYER CLASSIC somehow works.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

For UVC interface, CX3 is bound to the standard UVC driver from Windows. CyUSB.dll will not be applicable to be used in this case.

Libraries or applications that can support standard video streaming can be used to stream/receive the video data for UVC devices.

If the video format given in the USB descriptors is not YUY2/RGB, then ffmpeg host application can be used to receive RAW video data.

Best Regards,
AliAsgar

0 Likes