How add resolution ov5640 CX3 using gpif II

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

cross mob
VlKh_2251656
Level 5
Level 5
10 likes given 5 likes given First like received

Hello.

I have a denebola devboard (CX3 + OV5640)

I hope add any resolutions to USB2 type connection.

I made

1) add frame descriptors in descriptor file (for example 1280*720)

    /* Class specific Uncompressed VS frame descriptor 2 - 720p@ 60fps*/

    0x1E,                               /* Descriptor size */

    ES_UVC_CS_INTRFC_DESCR,             /* Descriptor type*/

    0x05,                               /* Subtype: Uncompressed frame interface*/

    0x02,                               /* Frame Descriptor Index: 2 */

    0x00,                               /* No Still image capture method supported */

    0x00, 0x05,                         /* Width in pixel: 1280 */

    0xD0, 0x02,                         /* Height in pixel: 720 */

    0x00, 0x00, 0x57, 0x00,             /* Min bit rate

    0x00, 0x00, 0xBC, 0x34,             /* Max bit rate

    0x00, 0x20, 0x1C, 0x00,             /* Maximum video frame size in bytes(Deprecated): 1280 x 720 x 2   */

    0x0A, 0x8B, 0x0E, 0x00,             /* Default frame interval (in 100ns units): (1/60)x10^7 */

    0x01,                               /* Frame interval type : No of discrete intervals */

    0x0A, 0x8B, 0x02, 0x00,             /* Frame interval 3: Same as Default frame interval */

2) add handler in code

if(FrameIndex == 0x01)

{

/* Write VGA Settings */

status = CyU3PMipicsiSetIntfParams (&cfgUvcVga30NoMclk, CyFalse);

if (status != CY_U3P_SUCCESS)

{

CyU3PDebugPrint (4, "\n\rUSBStpCB:SetIntfParams HS Err = 0x%x", status);

}

esOV5640_VGA_config();

esOV5640_VGA_HS_config();

}

else if(FrameIndex == 0x02)

{

/* Write VGA Settings */

status = CyU3PMipicsiSetIntfParams (&cfgUvcVga30NoMclk, CyFalse);

if (status != CY_U3P_SUCCESS)

{

CyU3PDebugPrint (4, "\n\rUSBStpCB:SetIntfParams HS Err = 0x%x", status);

}

esOV5640_VGA_config();

esOV5640_VGA_HS_config();

}

But I not understand how setup gpif , mipi lanes and probes, and ov5640 registers with this resolution

Many thanks

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

Please refer this App Note: How to Interface a MIPI® CSI-2 Image Sensor with EZ-USB® CX3:

http://www.cypress.com/file/126136/download

I have created an example MIPI configuration project for 720p 5fps.

Here is the MIPI configuration of the same.

/* OV5640_YUY2_Resolution0 :  */

CyU3PMipicsiCfg_t OV5640_YUY2_Resolution0 =

{

    CY_U3P_CSI_DF_YUV422_8_2,  /* CyU3PMipicsiDataFormat_t dataFormat */

    2,                          /* uint8_t numDataLanes */

    2, /* uint8_t pllPrd */

    89, /* uint16_t pllFbd */

    CY_U3P_CSI_PLL_FRS_250_500M, /* CyU3PMipicsiPllClkFrs_t pllFrs */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t parClkDiv */

    0,                /* uint16_t mClkCtl */

    CY_U3P_CSI_PLL_CLK_DIV_2, /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */

    1280,        /* uint16_t hResolution */

    50                        /* uint16_t fifoDelay */

};

UVC Probe Control Setting - 720p@ 5 fps are fine.

Do the following modifications in the firmware.

1. Modify the High Speed descriptor part - Add third frame index (720p, 5fps). Min bit rate and maximum bit rate to 1280 x 720 x 2 x 8 x 5 fps

2. Change the Counter values - LD_ADDR_COUNT and LD_DATA_COUNT counters need to be modified as per the selected data bus width and DMA Buffer size . Refer An75779. Becasue you are using 36 KB buffer size

3. Add the Mipi configration as said above

4. Also change the camera setting using the Brute Force method.

Once you do the above changes, check the device enumeration.

It supposed to come up as UVC  + CDC device. Open Device Manager and look for the UVC (Imaging devices) and CDC (COM Port) devices.

View solution in original post

35 Replies