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.

AM2732: MCU-PLUS-SDK-AM273X: CSI2 Interface Configuration

Part Number: AM2732
Other Parts Discussed in Thread: AWR2243, SYSCONFIG,

Hello,

I want to configure the CSI2 Interface in J1 connector with the below configurations:

Data type: RAW16 (0x2E)

Num of Lanes: 4

Line rate: 320 Mbps

Pixels per beat (clock): 2

Bits per component (pixel): 16

 

What should the corresponding configurations in syscfg be?

  • Hi Dimitra,

    There is an example for the CSI capture in the AM273x MCU+ SDK 09.02.00.60: C:\ti\mcu_plus_sdk_am273x_09_02_00_60\examples\drivers\csirx\csirx_internal_capture

    Please check it out.

    Best regards,

    Ming 

  • Hi Ming,

    I saw in TRM that it supports 16bit RAW data, but in syscfg I don't see to have that option too choose.

    Best regards,

    Dimitra

  • Hi Dimitra,

    You can change the data format in "Data Format" in syscfg as shown in the above screen shot!

    Best regards,

    Ming

  • Hi Ming,

    in in "Data Format" in syscfg in your screen shot there is no option for raw16. In the Technical Reference Manual page 3781 says that it has support for 8/10/12/14/16-bits RAW data mode, as shown in the screen shot.


    Moreover, I am trying to receive mipi csi2 rx signals from csi tx from an FPGA device. I am using as reference the AM273x MCU+ SDK 09.02.00.60 example. The FPGA is configured as I wrote in the thread description.
    What should the configurations in the syscfg be?
    I also found this thread: TMDS273GPEVM: AM273x - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums
    It is stated that the CSI-2 RX driver found in the AM273x MCU PLUS SDK 09.02.00.52 cannot be supported in a general purpose sensor attach mode.
    Does this apply also in my case with the FPGA device and the AM273x MCU+ SDK 09.02.00.60 driver?

    Best regards,
    Dimitra

  • Hi Dimitra,

    I talked to Randy about his comments on TMDS273GPEVM: AM273x - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums. He said that the AM273x MCU+ SDK 09.02.00.52 only supports AWR2243 CSI2 TX data (RAW8). The CSI driver is not tested/supported for anything else. If your FGPA is not explicitly support AWR2243 format, then there is no support for the CSI driver.

    form AM273x MCU+ SDK 09.02.00.52 to AM273x MCU+ SDK 09.02.00.60, only addition is the RCSS UART driver. The CSI driver remains the same, so the supported CSI format remains the same even though the TRM says differently.

    Best regards,

    Ming

  • Hi Ming,

    I made some modifications and I send from the FPGA RAW8 data, the same format AWR2243 CSI2 TX data are

    I still get the same error as the people in this thread   https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1351211/tmds273gpevm-am273x  .

    Is there anything else I should get into consideration besides the data format? Why do I get an error when running the function CSIRX_complexioGetPowerStatus? I used the steps described in the above thread link.

    Best regards,

    Dimitra

  • Hi Dimitra,

    By review the e2e thread you pointed out in your previous post. The issue seems to be the powerStatus never reaches the CSIRX_COMPLEXIO_POWER_STATUS_ON, I would check the CSI initialization, configuration, power up and enabling etc.

    Best regards,

    Ming

  • Hi Ming,

    I attach my code and maybe you or someone else from the CSI team can help me because I have reached a dead end searching through TI's forums regarding this issue. Please have someone look at this code/settings and tell me what I am doing wrong and I can't get past CSIRX_complexioGetPowerStatus(). It keeps returning that it is turned off. If there is something missing let me know and I will reply ASAP.

    csirx1.$name                                                = "CONFIG_CSIRX0";
    csirx1.instOpenEnable                                       = false;
    csirx1.phyEnable                                            = true;
    csirx1.dphy.$name                                           = "CONFIG_CSIRX_DPHY0";
    csirx1.dphy.ddrClockInHz                                    = 120000000;
    csirx1.complexio.$name                                      = "CONFIG_CSIRX_COMPLEXIO0";
    csirx1.common.$name                                         = "CONFIG_CSIRX_COMMON0";
    csirx1.common.commonCallback                                = "App_csirxCommonCallback";
    csirx1.common.endianness                                    = "CSIRX_ENDIANNESS_NATIVE_MIPI_CSI2 ";
    csirx1.common.isOcpError                                    = true;
    csirx1.common.isGenericShortPacketReceive                   = true;
    csirx1.common.isOneBitShortPacketErrorCorrect               = true;
    csirx1.common.isMoreThanOneBitShortPacketErrorCannotCorrect = true;
    csirx1.common.isComplexioError                              = true;
    csirx1.common.isFifoOverflow                                = true;
    csirx1.context[0].$name                                     = "CONFIG_CSIRX_CONTEXT0";
    csirx1.context[0].isNumLines                                = true;
    csirx1.context[0].userDefinedMapping                        = "CSIRX_USER_DEFINED_FORMAT_RAW8";
    csirx1.context[0].isEndOfFramePulseEnabled                  = true;
    csirx1.context[0].isEndOfLinePulseEnabled                   = true;
    csirx1.context[0].numLinesForIntr                           = 64;

    int main(void)
    {
        System_init();
        Board_init();

        csirx_internal_capture_main(NULL);

        Board_deinit();
        System_deinit();

        return 0;
    }

    void csirx_internal_capture_main(void *args)
    {
        /* Open all drivers including CSIRX driver, which is setup via SysConfig */
        Drivers_open();
        int32_t status_csi_func=0;
        status_csi_func = csifunc();
        // I can't even reach here
    .
    .
    .
    .
    .
    }

    int32_t csifunc(){
      extern uint32_t gCsirxConfigNum;
     extern CSIRX_Handle gCsirxHandle[CONFIG_CSIRX_NUM_INSTANCES];
     extern CSIRX_DphyConfig gCsirxDphyConfig[CONFIG_CSIRX_NUM_INSTANCES];
     extern CSIRX_ComplexioConfig gCsirxComplexioConfig[CONFIG_CSIRX_NUM_INSTANCES];
     extern CSIRX_CommonConfig gCsirxCommonConfig[CONFIG_CSIRX_NUM_INSTANCES];
     extern CSIRX_ContextConfig gConfigCsirx0ContextConfig[CONFIG_CSIRX0_NUM_CONTEXT];
      int32_t ret;
      ret = func1(0,1,gConfigCsirx0ContextConfig);
      return ret;
    }

    int32_t func1(uint32_t instanceId, uint16_t numContexts, CSIRX_ContextConfig *pContextConfig)
    {
       int32_t status = SystemP_SUCCESS;

        gCsirxHandle[instanceId] = CSIRX_open(CONFIG_CSIRX0);
        if(gCsirxHandle[instanceId] == NULL)
        {
            status = SystemP_FAILURE;
            DebugP_logError("CSIRX %d: CSIRX_open failed !!!\r\n", instanceId);
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_reset(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_reset failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_complexioSetConfig(gCsirxHandle[instanceId], &gCsirxComplexioConfig[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_complexioSetConfig failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_complexioDeassertReset(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_complexioDeassertReset failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_dphySetConfig(gCsirxHandle[instanceId], &gCsirxDphyConfig[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_dphySetConfig failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            /* Power on complex IO */
            status = CSIRX_complexioPowerOn(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_complexioPowerOn failed !!!\r\n", instanceId);
            }

            if(status == SystemP_SUCCESS)
            {
                uint32_t numComplexioPowerStatusPolls = 0;
                uint8_t powerStatus = 0;

                /* Wait until complex IO powered up */
                numComplexioPowerStatusPolls = 0;
                do
                {
                    status = CSIRX_complexioGetPowerStatus(gCsirxHandle[instanceId], &powerStatus);
                    if(status != SystemP_SUCCESS)
                    {
                        break;
                    }
                    ClockP_usleep(1000);
                    numComplexioPowerStatusPolls++;
                } while((powerStatus != CSIRX_COMPLEXIO_POWER_STATUS_ON) &&
                        (numComplexioPowerStatusPolls < 5) );

                if(powerStatus != CSIRX_COMPLEXIO_POWER_STATUS_ON)
                {
                    status = SystemP_FAILURE;
                }
                if(status!=SystemP_SUCCESS)
                {
                    DebugP_logError("CSIRX %d: CSIRX_complexioGetPowerStatus failed !!!\r\n", instanceId);
                }
            }
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_commonSetConfig(gCsirxHandle[instanceId], &gCsirxCommonConfig[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_commonSetConfig failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS && gCsirxPhyEnable[instanceId])
        {
            status = CSIRX_complexioAssertForceRxModeOn(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_complexioAssertForceRxModeOn failed !!!\r\n", instanceId);
            }

            if(status==SystemP_SUCCESS)
            {
                uint32_t numForceRxModeDeassertedPolls = 0;
                bool isForceRxModeDeasserted = false;

                /* wait until force rx mode deasserted: This may depend on Tx */
                do
                {
                    status = CSIRX_complexioIsDeassertForceRxModeOn(gCsirxHandle[instanceId],
                                                                        &isForceRxModeDeasserted);
                    if(status != SystemP_SUCCESS)
                    {
                        break;
                    }
                    ClockP_usleep(1000);
                    numForceRxModeDeassertedPolls++;
                } while( (isForceRxModeDeasserted == false) && (numForceRxModeDeassertedPolls < 5) );

                if(isForceRxModeDeasserted == false)
                {
                    status = SystemP_SUCCESS;
                }
                if(status!=SystemP_SUCCESS)
                {
                    DebugP_logError("CSIRX %d: CSIRX_complexioIsDeassertForceRxModeOn failed !!!\r\n", instanceId);
                }
            }
        }
        if(status==SystemP_SUCCESS)
        {
            uint32_t i;

            for(i = 0; i < numContexts; i++)
            {
                /* config contexts */
                status = CSIRX_contextSetConfig(gCsirxHandle[instanceId], i, &pContextConfig[i] );
                if(status!=SystemP_SUCCESS)
                {
                    DebugP_logError("CSIRX %d: CSIRX_contextSetConfig for context %d failed !!!\r\n", instanceId, i);
                }
                if(status != SystemP_SUCCESS)
                {
                    break;
                }
            }
        }
        if(status==SystemP_SUCCESS)
        {
            /* Debug mode, first flush FIFO - disable debug mode and enable interface */
            status = CSIRX_debugModeDisable(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_debugModeDisable failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            /* enable context */
            status = CSIRX_contextEnable(gCsirxHandle[instanceId], 0);
            if(status != SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_contextEnable failed !!!\r\n", 0);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            /* enable interface */
            status = CSIRX_commonEnable(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_commonEnable failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            uint32_t numComplexioDonePolls = 0;
            bool isResetDone = false;

            /* Wait until complex IO reset complete */
            do
            {
                status = CSIRX_complexioIsResetDone(gCsirxHandle[instanceId], &isResetDone);
                if(status!=SystemP_SUCCESS)
                {
                    break;
                }
                ClockP_usleep(1000);
                numComplexioDonePolls++;
            } while(( isResetDone == false));// && (numComplexioDonePolls < 5U) );

            if(isResetDone == false)
            {
                status = SystemP_FAILURE;
            }
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_complexioIsResetDone failed !!!\r\n", instanceId);
            }
        }
        return status;
    }
  • Hi Ming,

    Could we please have a response to that matter as it is very important to our development.

    Best regards,

    Konstantinos

  • Hello,

    Any updates on the issue?

    Best regards,

    Dimitra

  • We’ve been waiting for a reply regarding the AM2732 CSI-RX issue, and the lack of response is becoming very concerning. The TRM for the AM2732 contains multiple errors, inconsistencies, and missing information, especially regarding CSI-RX. You even advertise 16-bit RAW support, while the provided driver does not function at even the most basic level.

    We are not asking for anything unreasonable, only clarification and guidance so we can get CSI-RX working. Avoiding the topic or leaving posts unanswered is extremely unhelpful and feels unprofessional, especially when the documentation is incomplete.

    At the very least, please provide accurate details or a working example for CSI-RX initialization and bring-up. We simply need a clear path forward.