This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: How to set CSITX

Part Number: TDA4VM

Hi

expert.

I want to stream video using csitx to deserializer(max9295D).

Image format: 1280x944, 30fps, yuv422(uyvy)

I refered to "/tiovx/kernels_j7/hwa/test/test_csitx_csirx.c"

	csitx_cfg.numInst                          = 1U;
    csitx_cfg.numCh                            = 1;
    csitx_cfg.instId[0U]                       = 0;
    csitx_cfg.instCfg[0U].rxCompEnable         = (uint32_t)vx_true_e;
    csitx_cfg.instCfg[0U].rxv1p3MapEnable      = (uint32_t)vx_true_e;
    csitx_cfg.instCfg[0U].laneBandSpeed        = TIVX_CSITX_LANE_BAND_SPEED_1000_TO_1200_MBPS; // (1280x944x30x16x1.2)/(4*1024*1024)=165.9
    csitx_cfg.instCfg[0U].numDataLanes         = 4U;

	int idx = 0;
    for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
        csitx_cfg.instCfg[0U].lanePolarityCtrl[idx] = 1u;
    }

	for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
        csitx_cfg.chVcNum[idx]   = 0;
        csitx_cfg.chInstMap[idx] = 0;
    }
	csitx_param_obj = vxCreateUserDataObject(_obj->context, "tivx_csitx_params_t", sizeof(tivx_csitx_params_t), &csitx_cfg);
	if (vxGetStatus((vx_reference)csitx_param_obj) != VX_SUCCESS){
        APP_PRINTF("[ERROR] vxCreateUserDataObject() csitx_param_obj\n");
        return VX_FAILURE;
    }

	_obj->csitx_node = tivxCsitxNode(_obj->graph, csitx_param_obj, _obj->mosaic_frames);
	if (vxGetStatus((vx_reference)csitx_param_obj) != VX_SUCCESS){
        APP_PRINTF("[ERROR] tivxCsitxNode() \n");
        return VX_FAILURE;
    }

Q1. Is csitx set value correct?

Q2. I'd like to know concept of instance, channel, datalanes and virtual channel in CSI-2. That concept is hard to understand for me.

Thank you.

  • Hi Lee,

    Yes, the above looks correct, assuming mosaic frames is of yuv422 format type. 

    channels and virtual channels are exactly same, essentially tells us how many camera data we want to send. number of lanes are actual number of physical data lanes and number of instance is fixed to 1.

    Regards,

    Brijesh

  • I use one camera and four physical data lanes.

    I think laneBandSpeed is too fast. "TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS" is the lowest.

    How to set 169Mbps?

    Is the reason that the instance ID is '0' only one instance?

  • Which SDK release are you using? The lowest speed supported is 80Mbps per lane. Can you please latest release and then you could set the lane speed to CSITX_LANE_BAND_SPEED_160_TO_200_MBPS?

    Regards,

    Brijesh

  • I'm using sdk7_1 but I can't upgrade version. customer fixed.

    Q1. Is the reason that the instance ID is '0' only one instance?

    Q2. Could you tell me hex value of "CSITX_LANE_BAND_SPEED_160_TO_200_MBPS"?

    like #define TIVX_CSITX_LANE_BAND_SPEED_1400_TO_1600_MBPS           ((uint32_t) 0x12U)

    Thank you.

  • If not entire SDK, can you please update CSITX driver? There are few changes in CSITX driver, which will allow you set this lane speed. 

    Value of this CSITX_LANE_BAND_SPEED_160_TO_200_MBPS macro is 0x3, but i would recommend updating the driver, as there are other changes as well, which could be required for this lane speed. 

    Regards,

    Brijesh

  • Could you tell me where is update CSITX driver?

    Thank you.

  • Well latest driver is in SDK8.2 release, but this release supports FreeRTOS, where you are using SDK7.1, which is based on TI RTOS. Can you please try taking complete folder from ti-processor-sdk-rtos-j721e-evm-07_03_00_07\pdk_jacinto_07_03_00_29\packages\ti\drv\csitx ?

  • I copied csitx files in SDK7_3 completely but deserializer status is overflow error.

    "TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS" is defined in /tiovx/kernels_j7/include/TI/j7_csitx.h.

    Do I need to patch tiovx?

  • I tried to other way. I used csitx two lanes. I set deserializer for two lanes.

    Could you check TDA4vm set part?

    	tivx_csitx_params_init(&csitx_cfg);
    	csitx_cfg.numInst                          = 1U; 
        csitx_cfg.numCh                            = 1; 
        csitx_cfg.instId[0U]                       = 0; 
        csitx_cfg.instCfg[0U].rxCompEnable         = (uint32_t)vx_true_e;
        csitx_cfg.instCfg[0U].rxv1p3MapEnable      = (uint32_t)vx_true_e;
        csitx_cfg.instCfg[0U].laneBandSpeed        = TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS;
        csitx_cfg.instCfg[0U].numDataLanes         = 2U; 
    
    	int idx = 0;
        for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
            csitx_cfg.instCfg[0U].lanePolarityCtrl[idx] = 0u;
        }
    
    	for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
            csitx_cfg.chVcNum[idx]   = 0;
            csitx_cfg.chInstMap[idx] = 0;
        }

    This test result is same. Deserializer status is overflow error.

    Thank you.

  • Hi,

    The configuration seems correct. You are setting all required configuration. 

    Please check if lane speed and number of data lane are sufficient and similar configuration is done on deserializer side. 

    Regards,

    Brijesh

  • I did some tests to know the principle of MIPI clock set.

    All cast input image is same. The MIPI clock was measured with a scope.

    pclk: 1280x944x30*1.2 =  44Mhz

    land bandwidth: 44 * 16 / 4 = 174Mbps

    Expected MIPI clock: 174 / 2 = 87Mhz but 400Mhz.

    First case

    csitx_cfg.instCfg[0U].laneBandSpeed        = TIVX_CSITX_LANE_BAND_SPEED_1000_TO_1200_MBPS;

    csitx_cfg.instCfg[0U].numDataLanes         = 4U;

    result = 400Mhz

    Second case

    csitx_cfg.instCfg[0U].laneBandSpeed        = TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS;

    csitx_cfg.instCfg[0U].numDataLanes         = 4U;

    result = 400Mhz

    Third case 

    csitx_cfg.instCfg[0U].laneBandSpeed        = TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS;

    csitx_cfg.instCfg[0U].numDataLanes         = 2U;

    result = 400Mhz

    Q1. I wonder why there is no change in mipi clock. How can I change the MIPI clock?

    Thank you.

  • Hi Lee,

    The clock might be continuous, so you might not see clock output always. 

    Regarding same clock output for all lane speed, did you try CSITX driver from the latest release? This is because in earlier release, we had very limited lane band speed support, so if there is any unsupported lane band speed, driver will default to one lane band speed and so we would just get constant clock output.. 

    Regards,

    Brijesh

  • Hi,

    I changed MIPI clock so overflow error is resolved in serializer.

    I refer to https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1098418/tda4vm-change-csitx-clock-frequency?tisearch=e2e-sitesearch&keymatch=csitx#

    Now I get MIPI_ERR_FLAG in serializer.

    I use CSI set (1280x944x30x16 / 4lane / lane speed 200)

    Could I need to set params for CSITX?

    #define CSITX_LANE_BAND_SPEED       (TIVX_CSITX_LANE_BAND_SPEED_770_TO_870_MBPS)
    #define CSITX_LANE_SPEED_MBPS       (200U)
    	
    	memset(&csitx_cfg, 0, sizeof(tivx_csitx_params_t));
    	tivx_csitx_params_init(&csitx_cfg);
    	csitx_cfg.numInst                          = 1U;
        csitx_cfg.numCh                            = 1;
        csitx_cfg.instId[0U]                       = 0;
        csitx_cfg.instCfg[0U].rxCompEnable         = (uint32_t)vx_true_e;
        csitx_cfg.instCfg[0U].rxv1p3MapEnable      = (uint32_t)vx_true_e;
        csitx_cfg.instCfg[0U].laneBandSpeed        = CSITX_LANE_BAND_SPEED;
        csitx_cfg.instCfg[0U].laneSpeedMbps        = CSITX_LANE_SPEED_MBPS; (1280x944x30x16x1.2)/(4*1024*1024)=165.9 < 200
        csitx_cfg.instCfg[0U].numDataLanes         = 4U;
    
    	int idx = 0;
        for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
            csitx_cfg.instCfg[0U].lanePolarityCtrl[idx] = 0u;
        }
    
    	for (idx = 0U; idx < csitx_cfg.instCfg[0U].numDataLanes; idx++){
            csitx_cfg.chVcNum[idx]   = 0;
            csitx_cfg.chInstMap[idx] = 0;
        }

    Thank you.

  • Hi Lee,

    Nothing from CSITX. This looks fine. 

    Not sure when MIPI_ERR_FLAG is set. Could you please check in serializer specs? 

    Regards,

    Brijesh

  • Hi

    I want to know registor for checking CSTTX device status.

    Let me know registor addr or docs?

    Thank you.

  • Hi

    I found function that print CSITX status "tivxCsitxControl".

    I want to know calling method "TIVX_CSITX_GET_STATISTICS", "TIVX_CSITX_PRINT_STATISTICS" in "tivxCsitxControl" function.

    Thank you.

  • Hi Lee,

    I want to know registor for checking CSTTX device status.

    What exactly do you want to check in CSITX? Registers details are available in TRM/Specs.

    I want to know calling method "TIVX_CSITX_GET_STATISTICS", "TIVX_CSITX_PRINT_STATISTICS" in "tivxCsitxControl" function.

    Yes, these IOCTLs can provide few stats like number of frames queeued, dequeued, repeated, overflow status etc.. Is that what you are looking for? 

    Regards,

    Brijesh