cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

VlKh_2251656
Contributor II

Good day.

Now, we made our custom video camera on chip Cypress CX3 and optical sensor ov5640.

We took a "Denebola" debugging kit, its scheme and software as a sample.

During operation, the device is normally identified as a UVC device.

All the settings are available (brightness, color, resolution selection, ...)

There is communication with the sensor on the line I2C.

But there is no transmission of video information, that is, the media player window shows: 0 fps and black screen...

Please, Tell me, what could be the cause of this phenomenon?

Bad contact or lack of contact between the sensor and the cypress chip along the MIPI lane? Distortion signal MIPI?

Tell me, please, is it possible to programmatically check whether the correct mipi signal comes from the sensor OV560 to the cypress CX3?

PCB makers say they did everything right.

0 Likes
1 Solution
abhinavg_21
Moderator
Moderator

Please go through the following troubleshooting steps and confirm.

CX3 Firmware Trouble shooting Guide

  1. Question

I have interfaced CX3 with an image sensor which supports MIPI CSI protocol. When I connect it to the PC and open the UVC player, I am able to see black screen. How can I fix this?

Answer:

  1. Probe the MIPI data & clock lanes. Ensure that they are toggling as expected.
  2. Is the MIPI clock gated or continuous? If the sensor is streaming in continuous clock mode, follow the steps mentioned in question 13 of the following link:

http://www.cypress.com/knowledge-base-article/cx3-hardware-frequently-asked-questions-kba91295

  1. Print the MIPI CSI error counts over UART by using the API “CyU3PMipicsiGetErrors”. Check if any of the error count is non-zero.

If yes, double check the sensor configuration.

  1. Vary the ‘thsSettleDelay’ parameter of “CyU3PMipicsiSetPhyTimeDelay()” API to check if the sensor is streaming for any of the delay
  • value. Keep the first parameter as 0x01 always.
    1. If you were able to get zero MIPI errors and if the video is still not streaming probe the following test points

     CX3 pin#

                Test Signal Name

H8

                  PCLK test signal

G6

                  HSYNC test signal

H5

                  VSYNC test signal

If only H8 toggles but not the other pins then MIPI CSI configuration may not be correct. Enter the correct values of MIPI CSI image

sensor outputs in the tool and configure the PLL dividers appropriately so that the tool will not generate any errors. Make sure to use the latest CX3 configuration tool plugins.

  1. Ensure that all the unused MIPI data lanes are grounded.

Probe all the three test signals (H8, G6 & H5) using oscilloscope and attach screenshot.

Thanks & Regards

Abhinav Garg

View solution in original post

20 Replies
VlKh_2251656
Contributor II

It's photo:

0 Likes
abhinavg_21
Moderator
Moderator

Hi Vladimir,

Are you facing this issue only with the custom PCB board or with Denabola kit also? Please enable the debug log messages and share the debug logs.  Also probe the MIPI data lanes to check for the data.

Thanks & Regards
Abhinav

0 Likes
VlKh_2251656
Contributor II

Only in custom board.

screen_.jpg

Full log in attachment file.

0 Likes
VlKh_2251656
Contributor II

Good day

I added another task for MIPI errors printing:

void myThread_Entry(uint32_t input)

{

CyU3PMipicsiErrorCounts_t errorCounts;

uint32_t sum = 0;

while(1)

{

          CyU3PMipicsiGetErrors (CyFalse, &errorCounts);

          sum = errorCounts.crcErrCnt +

          errorCounts.ctlErrCnt +

          errorCounts.eidErrCnt +

          errorCounts.frmErrCnt +

          errorCounts.mdlErrCnt +

          errorCounts.recSyncErrCnt +

          errorCounts.recrErrCnt +

          errorCounts.unrSyncErrCnt +

          errorCounts.unrcErrCnt;

          CyU3PDebugPrint (4, "\n\r mipi errors = 0x%x", sum);

          CyU3PThreadSleep(1000);

     }

}

I look at the output in the terminal:

          mipi errors = 0x0

That is, there are no mipi errors?

If the mipi signal does not come or is distorted, will this be shown in these errors?

Many thanks.

0 Likes
VlKh_2251656
Contributor II

I modified the project code a lot:

// GpifCB callback function is invoked when FV triggers GPIF interrupt */

void esUVCGpifCB (CyU3PGpifEventType event, uint8_t currentState)

{

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;

    // Handle interrupt from the State Machine */

    if (event == CYU3P_GPIF_EVT_SM_INTERRUPT)

    {

        // Wrapup Socket 0*/

        if(currentState == CX3_PARTIAL_BUFFER_IN_SCK0)

        {

            status = CyU3PDmaMultiChannelSetWrapUp(&glChHandleUVCStream, 0);

            if (status != CY_U3P_SUCCESS)

            {

                CyU3PDebugPrint (4, "\n\rGpifCB:WrapUp SCK0 Err = 0x%x", status);

            }

        }

        // Wrapup Socket 1 */

        else if(currentState == CX3_PARTIAL_BUFFER_IN_SCK1)

        {

            status = CyU3PDmaMultiChannelSetWrapUp(&glChHandleUVCStream, 1);

            if (status != CY_U3P_SUCCESS)

            {

                CyU3PDebugPrint (4, "\n\rGpifCB:WrapUp SCK1 Err = 0x%x", status);

            }

        }

      CyU3PDebugPrint (4, ".");

    }

}

Adding line debug print:

        CyU3PDebugPrint (4, ".");

Added debug in terminal output when receiving a frame.

On the denebol board there is a symbol "." output,

mipi errors = 0x0

...................

mipi errors = 0x0

...................

mipi errors = 0x0

...................

Tell me, is this correct?

But on our custom board it is not symbol ".".

mipi errors = 0x0

mipi errors = 0x0

mipi errors = 0x0

Tell me, can this indicate that we are not receiving video information on line MiPi?

Many thanks.

0 Likes
VlKh_2251656
Contributor II

Or, no......

many, many MIPI errors.....

o....

0 Likes
VlKh_2251656
Contributor II

Yes!

Please, see:

typedef struct CyU3PMipicsiErrorCounts_t

{

    uint8_t frmErrCnt;          /**< Framing Error Count*/

    uint8_t crcErrCnt;          /**< CRC Error Count*/

    uint8_t mdlErrCnt;          /**< Multi-Data Lane Sync Byte Error Count*/

   uint8_t ctlErrCnt;          /**< Control Error (Incorrect Line State Sequence) Count*/

    uint8_t eidErrCnt;          /**< Unsupported Packet ID Error Count */

    uint8_t recrErrCnt;         /**< Recoverable Packet Header Error Count*/

    uint8_t unrcErrCnt;         /**< Unrecoverable Packet Header Error Count*/

    uint8_t recSyncErrCnt;      /**< Recoverable Sync Byte Error Count*/

    uint8_t unrSyncErrCnt;      /**< Unrecoverable Sync Byte Error Count*/

} CyU3PMipicsiErrorCounts_t;

And value ctlErrCnt is very big...

0 Likes
KandlaguntaR_36
Moderator
Moderator

Hello,

Can you please print all the mipi errors individually instead sum?

As per previous response, you are seeing ctlErrCnt errors. Please confirm.

If yes, please check whether you have connected the MIPI lines properly.

0 lane of sensor with 0 lane of CX3 MIPI, 1 lane of sensor with 1 lane of CX3 MIPI, 2 lane of sensor with 2 lane of CX3 MIPI and 3 lane of sensor with 3 lane of CX3 MIPI.

Also Probe HSYNC_Test and VSYNC_Test Pins and share the active and blanking time.

If there are any mipi errors, you will not see proper VSYNC and HSYNC signals.

0 Likes
VlKh_2251656
Contributor II

Yes.

Error ctlErrCnt occurs sometimes, but not very often.

More often it appears when connecting via USB3.

Thank you very much.

0 Likes
VlKh_2251656
Contributor II

Many thanks

Now I look vsync and hsync

I wiil answer about vsyns, hsync in next post

0 Likes
VlKh_2251656
Contributor II

Dear,

now I look oscillograms

For example, USB3 connection, resolution 640*480, 60 fps.

Only hsync sygnal ( ? )

Freq above 30 kHz.

0 Likes
VlKh_2251656
Contributor II

Oscillls in attachment

0 Likes
VlKh_2251656
Contributor II

It's hsync sygnal ?

Very corrupt sinus sygnal.

No other sygnals...

0 Likes
VlKh_2251656
Contributor II

In other scales:

0 Likes
VlKh_2251656
Contributor II

More images

0 Likes
VlKh_2251656
Contributor II

Or It's pclk sygnal with hsync strobing....

It seems that the signal is trying to synchronize, and then the synchronization fails ...

Many thanks.

0 Likes
abhinavg_21
Moderator
Moderator

Please go through the following troubleshooting steps and confirm.

CX3 Firmware Trouble shooting Guide

  1. Question

I have interfaced CX3 with an image sensor which supports MIPI CSI protocol. When I connect it to the PC and open the UVC player, I am able to see black screen. How can I fix this?

Answer:

  1. Probe the MIPI data & clock lanes. Ensure that they are toggling as expected.
  2. Is the MIPI clock gated or continuous? If the sensor is streaming in continuous clock mode, follow the steps mentioned in question 13 of the following link:

http://www.cypress.com/knowledge-base-article/cx3-hardware-frequently-asked-questions-kba91295

  1. Print the MIPI CSI error counts over UART by using the API “CyU3PMipicsiGetErrors”. Check if any of the error count is non-zero.

If yes, double check the sensor configuration.

  1. Vary the ‘thsSettleDelay’ parameter of “CyU3PMipicsiSetPhyTimeDelay()” API to check if the sensor is streaming for any of the delay
  • value. Keep the first parameter as 0x01 always.
    1. If you were able to get zero MIPI errors and if the video is still not streaming probe the following test points

     CX3 pin#

                Test Signal Name

H8

                  PCLK test signal

G6

                  HSYNC test signal

H5

                  VSYNC test signal

If only H8 toggles but not the other pins then MIPI CSI configuration may not be correct. Enter the correct values of MIPI CSI image

sensor outputs in the tool and configure the PLL dividers appropriately so that the tool will not generate any errors. Make sure to use the latest CX3 configuration tool plugins.

  1. Ensure that all the unused MIPI data lanes are grounded.

Probe all the three test signals (H8, G6 & H5) using oscilloscope and attach screenshot.

Thanks & Regards

Abhinav Garg

View solution in original post

VlKh_2251656
Contributor II

Where should I use this function?

It will be right ?

CyU3PMipicsiSetPhyTimeDelay(0x01, 0x3f);

status = CyU3PMipicsiSetIntfParams (&cfgUvcVga30NoMclk, CyFalse);

if (status != CY_U3P_SUCCESS)

{

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

}

esOV5640_VGA_config();

Thank you very much.

0 Likes
VlKh_2251656
Contributor II

Thank you very much for your answer.

Yes, the signal is only on the PCLK pin.

That is, if you follow your letter, then we have the wrong settings for the MIPI module.

But the fact is that we use a chip CX3 and a sensor OV5640. That is the same ones that are used in Denebola devkit.

Code we took the same one that is used in Denebola.

We assume that if the sensor is the same, then the MIPI settings should be the same.

Or is it wrong?

MIPI settings may vary depending on the topology of the placement of elements?

Or from release to release of products (CX3, OV5640) or any capacitors or inductors ?

0 Likes
abhinavg_21
Moderator
Moderator

Yes settings should be same. You have to verify that the pin connections are correct.

Regards

Abhinav