The CX3 device has an integrated MIPI CSI-2 block, which is hard-wired to the GPIF II interface on one side and provides a MIPI CSI-2 interface on the other side to interface to an image sensor that supports MIPI CSI-2. To stream data using CX3, both the MIPI receiver block and the sensor needs to be configured. Also, the configurations for the sensor and the MIPI receiver block should match. If this does not happen, then the sampled data will not be proper.
So for each resolution that you want to stream, a corresponding configuration for the MIPI receiver block needs to be generated. Also, the MIPI receiver block should be configured (using the configuration generated by the MIPI configuration utility) before configuring the sensor.
Thanks for you quick response.
I agree that the configurations of the sensor and the MIPI receiver must match.
But I want to know if its possible to "create" a new configuration (resolution, pixels format) that didn't pre-configured in the MIPI configuration utility. (of course that the sensor will be configured accordingly)
Let's say, the CX3 can receive the relevant parameters for the mipi block and the sensor from the host (custom protocol over USB), create a structure of CyU3PMipicsiCfg_t, configure the MIPI block with it, reconfigure the sensor and start streaming.
Is this scenario is possible? Or I must use the MIPI configuration utility no matter what
Yes, you can try the approach that you have mentioned in your previous response. For this, the following needs to be done:
a. Declare a MIPI configuration structure and sensor configuration structure(if you want to configure sensor also on the run).
b. Use vendor commands with the configuration data for updating the required structure.
c. Configure the MIPI block and the sensor.
While doing so, please ensure that the video frame ends with a partial buffer (DMA Buffer) on CX3. Otherwise, the streaming will get stuck. Please use an appropriate DMA buffer size or adjust the size of the video frame so that the frame size is not exactly divisible with DMA buffer size. The same is mentioned in the verified answer of the following thread:
Please use an appropriate DMA buffer size or adjust the size of the video frame so that the frame size is not exactly divisible with DMA buffer size.
>> So I need to change the DMA buffer size too. Is this change should be before all other configurations? (MIPI block and sensor)
Do I need somehow to stop the acquisition process?
The DMA buffer size needs to be set while creating the DMA channel for video streaming. The following snapshot shows the code for creation of DMA channel:
Once the DMA channel size is set (while creating the DMA channel), you should not change it. While creating the DMA channel, you should ensure that the DMA channel size satisfies the following:
1. Is a multiple of 16.
2. The frame size (in bytes) should not be completely divisible by the DMA buffer size.