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.

AWR2944: receive data from CSI2

Part Number: AWR2944
Other Parts Discussed in Thread: SYSCONFIG

Hi Team, 

Good day. I am posting this inquiry on behalf of the customer.

"I want to receive data from csi2 (awr2944), but CSI2 PHY RESET_DONE is not coming"

I config csi2 by sysconfig
===========
const csirx = scripting.addModule("/drivers/csirx/csirx", {}, false);
const csirx1 = csirx.addInstance();

/**
* Write custom configuration values to the imported modules.
*/
csirx1.$name = "CONFIG_CSIRX0";
csirx1.dphy.$name = "CONFIG_CSIRX_DPHY0";
csirx1.phyEnable = true;
csirx1.dphy.ddrClockInHz = 400000000;
csirx1.complexio.$name = "CONFIG_CSIRX_COMPLEXIO0";
csirx1.common.$name = "CONFIG_CSIRX_COMMON0";
csirx1.common.commonCallback = "App_csirxCommonCallback";
csirx1.context.create(3);
csirx1.context[0].$name = "CONFIG_CSIRX_CONTEXT0";
csirx1.context[0].virtualChannelId = 0;
csirx1.context[0].pingPongSwitchMode = "CSIRX_PING_PONG_LINE_SWITCHING";
csirx1.context[0].isFrameEndCodeDetect = true;
csirx1.context[0].isFrameStartCodeDetect = true;
csirx1.context[1].$name
======

Do I need to configure anything else?

Thank you for extending your help. Your support is much appreciated.

Kind regards, 

Marvin

  • Hi ,

    I found a similar case(RTOS/TDA2P-ACD: CSI2 PHY RESET_DONE is not coming - Processors forum - Processors - TI E2E support forums)

    but i don't know how did they solve it.

    How to enabling de-serializer.

    guilin.shi

  • Hello Marvin,

    Could you ask the customer to share the sysconfig generated files?
    From there we can figure out how what is causing the issue on the reset_phy.

    Regards,
    Saswat Kumar

  • Hello Saswat ,

    this is my dss.sysconf content

    =======

    /**
    * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
    * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    * @cliArgs --device "AWR294X" --package "ETS" --part "Default" --context "c66ss0" --product "MCU_PLUS_SDK_AWR2944@08.02.00"
    * @versions {"tool":"1.11.0+2225"}
    */

    /**
    * Import the modules used in this configuration.
    */
    const crc = scripting.addModule("/drivers/crc/crc", {}, false);
    const crc1 = crc.addInstance();
    const cbuff = scripting.addModule("/drivers/cbuff/cbuff", {}, false);
    const cbuff1 = cbuff.addInstance();
    const adcbuf = scripting.addModule("/drivers/adcbuf/adcbuf", {}, false);
    const adcbuf1 = adcbuf.addInstance();
    const edma = scripting.addModule("/drivers/edma/edma", {}, false);
    const edma1 = edma.addInstance();
    const edma2 = edma.addInstance();
    const hwa = scripting.addModule("/drivers/hwa/hwa", {}, false);
    const hwa1 = hwa.addInstance();
    const ipc = scripting.addModule("/drivers/ipc/ipc");
    const cache_c6x = scripting.addModule("/kernel/dpl/cache_c6x");
    const debug_log = scripting.addModule("/kernel/dpl/debug_log");
    const csirx = scripting.addModule("/drivers/csirx/csirx", {}, false);
    const csirx1 = csirx.addInstance();


    csirx1.$name = "CONFIG_CSIRX0";
    csirx1.dphy.$name = "CONFIG_CSIRX_DPHY0";
    csirx1.phyEnable = true;
    csirx1.dphy.ddrClockInHz = 400000000;
    csirx1.complexio.$name = "CONFIG_CSIRX_COMPLEXIO0";
    csirx1.common.$name = "CONFIG_CSIRX_COMMON0";
    csirx1.complexio.dataLane3_position = "CSIRX_LANE_POSITION_LANE_NOT_USED";
    csirx1.complexio.dataLane2_position = "CSIRX_LANE_POSITION_LANE_NOT_USED";
    csirx1.common.commonCallback = "App_csirxCommonCallback";
    csirx1.context.create(3);
    csirx1.context[0].$name = "CONFIG_CSIRX_CONTEXT0";
    csirx1.context[0].virtualChannelId = 0;
    csirx1.context[0].pingPongSwitchMode = "CSIRX_PING_PONG_LINE_SWITCHING";
    csirx1.context[0].isFrameEndCodeDetect = true;
    csirx1.context[0].isFrameStartCodeDetect = true;
    csirx1.context[1].$name = "CONFIG_CSIRX_CONTEXT1";
    csirx1.context[1].virtualChannelId = 1;
    csirx1.context[1].pingPongSwitchMode = "CSIRX_PING_PONG_LINE_SWITCHING";
    csirx1.context[1].isFrameEndCodeDetect = true;
    csirx1.context[1].isFrameStartCodeDetect = true;
    csirx1.context[2].$name = "CONFIG_CSIRX_CONTEXT2";
    csirx1.context[2].virtualChannelId = 2;
    csirx1.context[2].pingPongSwitchMode = "CSIRX_PING_PONG_LINE_SWITCHING";
    csirx1.context[2].isFrameEndCodeDetect = true;
    csirx1.context[2].isFrameStartCodeDetect = true;

    /**
    * Write custom configuration values to the imported modules.
    */
    crc1.$name = "CONFIG_CRC0";

    edma1.$name = "CONFIG_EDMA0";
    edma1.instance = "EDMA_DSS_A";
    edma1.edmaRmDmaCh[0].$name = "CONFIG_EDMA_RM0";
    edma1.edmaRmDmaCh[0].resourceType = scripting.forceWrite("ownDmaCh");
    edma1.edmaRmDmaCh[0].endIndex = 63;
    edma1.edmaRmQdmaCh[0].$name = "CONFIG_EDMA_RM1";
    edma1.edmaRmTcc[0].$name = "CONFIG_EDMA_RM2";
    edma1.edmaRmTcc[0].endIndex = 63;
    edma1.edmaRmParam[0].$name = "CONFIG_EDMA_RM3";
    edma1.edmaRmParam[0].endIndex = 127;
    edma1.edmaRmReservedDmaCh[0].$name = "CONFIG_EDMA_RM4";

    edma2.$name = "CONFIG_EDMA1";
    edma2.instance = "EDMA_DSS_B";
    edma2.regionId = 0;
    edma2.edmaRmDmaCh[0].resourceType = scripting.forceWrite("ownDmaCh");
    edma2.edmaRmDmaCh[0].$name = "CONFIG_EDMA_RM10";
    edma2.edmaRmDmaCh[0].startIndex = 0;
    edma2.edmaRmDmaCh[0].endIndex = 63;
    edma2.edmaRmQdmaCh[0].$name = "CONFIG_EDMA_RM11";
    edma2.edmaRmTcc[0].$name = "CONFIG_EDMA_RM12";
    edma2.edmaRmTcc[0].startIndex = 0;
    edma2.edmaRmTcc[0].endIndex = 63;
    edma2.edmaRmParam[0].$name = "CONFIG_EDMA_RM13";
    edma2.edmaRmParam[0].startIndex = 0;
    edma2.edmaRmParam[0].endIndex = 127;
    edma2.edmaRmReservedDmaCh[0].$name = "CONFIG_EDMA_RM14";
    edma2.edmaRmReservedDmaCh[0].startIndex = 0;
    edma2.edmaRmReservedDmaCh[0].endIndex = 0;

    hwa1.$name = "CONFIG_HWA0";

    ipc.vringNumBuf = 1;
    ipc.vringMsgSize = 1152;
    ipc.r5fss0_1 = "NONE";

    cache_c6x.marRegionConfig.create(2);
    cache_c6x.marRegionConfig[0].$name = "kernel_dpl_cache_c6x_mar0";
    cache_c6x.marRegionConfig[0].baseAddr = 0xC5000000;
    cache_c6x.marRegionConfig[1].$name = "kernel_dpl_cache_c6x_mar1";
    cache_c6x.marRegionConfig[1].baseAddr = 0x83000000;

    debug_log.enableCssLog = false;

    =======

    I don't know how to share the file without you. Please forgive me

    guilin.shi

  • Hello Saswat ,

    This case has any solution?

    Looking forward to your reply。

    thanks!

    guilin.shi

  • Hello guilin shi,

    These are not the sysconfig generated files. This is just the config file.
    Could you share me the file named ti_drivers_open_close.c ?

    Regards,
    Saswat Kumar

  • Hello Saswat,

    This is the file message for di_drivers_open_close.c

    ============

    /*
     *  Copyright (C) 2021 Texas Instruments Incorporated
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */

    /*
     * Auto generated file - DO NOT MODIFY
     */

    #include "ti_drivers_open_close.h"
    #include <kernel/dpl/DebugP.h>

    void Drivers_open(void)
    {

        Drivers_edmaOpen();
        Drivers_csirxOpen();
    }

    void Drivers_close(void)
    {
        Drivers_csirxClose();
        Drivers_edmaClose();
    }

    /*
     * CSIRX
     */

    /* CSIRX Driver handles */
    CSIRX_Handle gCsirxHandle[CONFIG_CSIRX_NUM_INSTANCES];

    /* CSIRX flag to control phy init during driver open */
    bool gCsirxPhyEnable[CONFIG_CSIRX_NUM_INSTANCES] = {
        true,
    };

    /* CSIRX Dphy config */
    CSIRX_DphyConfig gCsirxDphyConfig[CONFIG_CSIRX_NUM_INSTANCES] = {
        { /* CONFIG_CSIRX0 */
            .ddrClockInHz = 400000000U,
            .isClockMissingDetectionEnabled = true,
            .triggerEscapeCode = { 0000 },
        },
    };

    /* CSIRX complex IO config */
    CSIRX_ComplexioConfig gCsirxComplexioConfig[CONFIG_CSIRX_NUM_INSTANCES] = {
        { /* CONFIG_CSIRX0 */
            .lanesConfig =
            {
                .dataLane =
                {
                    {
                        .polarity = CSIRX_LANE_POLARITY_PLUS_MINUS,
                        .position = CSIRX_LANE_POSITION_1,
                    },
                    {
                        .polarity = CSIRX_LANE_POLARITY_PLUS_MINUS,
                        .position = CSIRX_LANE_POSITION_2,
                    },
                    {
                        .polarity = CSIRX_LANE_POLARITY_PLUS_MINUS,
                        .position = CSIRX_LANE_POSITION_LANE_NOT_USED,
                    },
                    {
                        .polarity = CSIRX_LANE_POLARITY_PLUS_MINUS,
                        .position = CSIRX_LANE_POSITION_LANE_NOT_USED,
                    },
                },
                .clockLane =
                {
                    .polarity = CSIRX_LANE_POLARITY_PLUS_MINUS,
                    .position = CSIRX_LANE_POSITION_3,
                },
            },
            .enableIntr =
            {
                .isAllLanesEnterULPM = false,
                .isAllLanesExitULPM = false,
                .dataLane =
                {
                    {
                        .isStateTransitionToULPM = true,
                        .isControlError = true,
                        .isEscapeEntryError = true,
                        .isStartOfTransmissionSyncError = true,
                        .isStartOfTransmissionError = true,
                    },
                    {
                        .isStateTransitionToULPM = true,
                        .isControlError = true,
                        .isEscapeEntryError = true,
                        .isStartOfTransmissionSyncError = true,
                        .isStartOfTransmissionError = true,
                    },
                    {
                        .isStateTransitionToULPM = true,
                        .isControlError = true,
                        .isEscapeEntryError = true,
                        .isStartOfTransmissionSyncError = true,
                        .isStartOfTransmissionError = true,
                    },
                    {
                        .isStateTransitionToULPM = true,
                        .isControlError = true,
                        .isEscapeEntryError = true,
                        .isStartOfTransmissionSyncError = true,
                        .isStartOfTransmissionError = true,
                    },
                },
                .clockLane =
                {
                    .isStateTransitionToULPM = true,
                    .isControlError = true,
                    .isEscapeEntryError = true,
                    .isStartOfTransmissionSyncError = true,
                    .isStartOfTransmissionError = true,
                },
            },
            .isPowerAuto = false,
        },
    };

    /* Callbacks */

    /* Callbacks for CONFIG_CSIRX0 */
    void App_csirxCommonCallback(CSIRX_Handle handlevoid *argstruct CSIRX_CommonIntr_s *irq);

    /* Callbacks Args for CONFIG_CSIRX0 */

    /* CSIRX common config */
    CSIRX_CommonConfig gCsirxCommonConfig[CONFIG_CSIRX_NUM_INSTANCES] = {
        { /* CONFIG_CSIRX0 */
            .isSoftStoppingOnInterfaceDisable = true,
            .isHeaderErrorCheckEnabled = false,
            .isSignExtensionEnabled = false,
            .isBurstSizeExpand = false,
            .burstSize = CSIRX_BURST_SIZE_8X64, /* NOT USED when isBurstSizeExpand is false */
            .isNonPostedWrites = true,
            .isOcpAutoIdle = true,
            .stopStateFsmTimeoutInNanoSecs = CSIRX_STOP_STATE_FSM_TIMEOUT_MAX,
            .endianness = CSIRX_ENDIANNESS_LITTLE_ENDIAN,
            .startOfFrameIntr0ContextId = 0,
            .startOfFrameIntr1ContextId = 0,
            .endOfFrameIntr0ContextId = 0,
            .endOfFrameIntr1ContextId = 0,
            .enableIntr =
            {
                .isOcpError = false,
                .isGenericShortPacketReceive = false,
                .isOneBitShortPacketErrorCorrect = false,
                .isMoreThanOneBitShortPacketErrorCannotCorrect = false,
                .isComplexioError = false,
                .isFifoOverflow = false,
                .isContextIntr = {
                    true,
                    true,
                    true,
                    false,
                    false,
                    false,
                    false,
                    false,
                },
            },
            .intrCallbacks =
            {
                .combinedEndOfLineCallback = NULL,
                .combinedEndOfLineCallbackArgs = NULL/* will be set later in Drivers_csirxOpen */
                .combinedEndOfFrameCallback = NULL,
                .combinedEndOfFrameCallbackArgs = NULL/* will be set later in Drivers_csirxOpen */
                .commonCallback = App_csirxCommonCallback,
                .commonCallbackArgs = NULL/* will be set later in Drivers_csirxOpen */
                .startOfFrameIntr0Callback = NULL,
                .startOfFrameIntr0CallbackArgs = NULL/* will be set later in Drivers_csirxOpen */
                .startOfFrameIntr1Callback = NULL,
                .startOfFrameIntr1CallbackArgs = NULL/* will be set later in Drivers_csirxOpen */
            },
        },
    };

    /* CSIRX context configurations */

    /* CSIRX CONFIG_CSIRX0 context config */
    CSIRX_ContextConfig gConfigCsirx0ContextConfig[CONFIG_CSIRX0_NUM_CONTEXT] =
    {
        { /* context 0 */
            .virtualChannelId = 0,
            .format = CSIRX_FORMAT_RAW8,
            .userDefinedMapping = CSIRX_USER_DEFINED_FORMAT_RAW6,
            .numFramesToAcquire = 0,
            .numLinesForIntr = 2,
            .alpha = 0,
            .isByteSwapEnabled = false,
            .isGenericEnabled = false,
            .isEndOfFramePulseEnabled = false,
            .isEndOfLinePulseEnabled = false,
            .isPayloadChecksumEnable = false,
            .isGenerateIntrEveryNumLinesForIntr = true,
            .transcodeConfig =
            {
                .transcodeFormat = CSIRX_TRANSCODE_FORMAT_NO_TRANSCODE,
                .isHorizontalDownscalingBy2Enabled = false,
                .crop =
                {
                    .horizontalCount = 0,
                    .horizontalSkip = 0,
                    .verticalCount = 0,
                    .verticalSkip = 0,
                },
            },
            .pingPongConfig =
            {
                .pingAddress = 0,
                .pongAddress = 0,
                .lineOffset = 0,
                .pingPongSwitchMode = CSIRX_PING_PONG_LINE_SWITCHING,
                .numFramesForFrameBasedPingPongSwitching = 1,
                .numLinesForLineBasedPingPongSwitching = 2,
            },
            .enableIntr =
            {
                .isNumLines = false,
                .isFramesToAcquire = false,
                .isPayloadChecksumMismatch = false,
                .isLineStartCodeDetect = false,
                .isLineEndCodeDetect = false,
                .isFrameStartCodeDetect = true,
                .isFrameEndCodeDetect = true,
                .isLongPacketOneBitErrorCorrect = false,
            },
            .eolCallback = NULL,
            .eolCallbackArgs = NULL,
        },
        { /* context 1 */
            .virtualChannelId = 1,
            .format = CSIRX_FORMAT_RAW8,
            .userDefinedMapping = CSIRX_USER_DEFINED_FORMAT_RAW6,
            .numFramesToAcquire = 0,
            .numLinesForIntr = 2,
            .alpha = 0,
            .isByteSwapEnabled = false,
            .isGenericEnabled = false,
            .isEndOfFramePulseEnabled = false,
            .isEndOfLinePulseEnabled = false,
            .isPayloadChecksumEnable = false,
            .isGenerateIntrEveryNumLinesForIntr = true,
            .transcodeConfig =
            {
                .transcodeFormat = CSIRX_TRANSCODE_FORMAT_NO_TRANSCODE,
                .isHorizontalDownscalingBy2Enabled = false,
                .crop =
                {
                    .horizontalCount = 0,
                    .horizontalSkip = 0,
                    .verticalCount = 0,
                    .verticalSkip = 0,
                },
            },
            .pingPongConfig =
            {
                .pingAddress = 0,
                .pongAddress = 0,
                .lineOffset = 0,
                .pingPongSwitchMode = CSIRX_PING_PONG_LINE_SWITCHING,
                .numFramesForFrameBasedPingPongSwitching = 1,
                .numLinesForLineBasedPingPongSwitching = 2,
            },
            .enableIntr =
            {
                .isNumLines = false,
                .isFramesToAcquire = false,
                .isPayloadChecksumMismatch = false,
                .isLineStartCodeDetect = false,
                .isLineEndCodeDetect = false,
                .isFrameStartCodeDetect = true,
                .isFrameEndCodeDetect = true,
                .isLongPacketOneBitErrorCorrect = false,
            },
            .eolCallback = NULL,
            .eolCallbackArgs = NULL,
        },
        { /* context 2 */
            .virtualChannelId = 2,
            .format = CSIRX_FORMAT_RAW8,
            .userDefinedMapping = CSIRX_USER_DEFINED_FORMAT_RAW6,
            .numFramesToAcquire = 0,
            .numLinesForIntr = 2,
            .alpha = 0,
            .isByteSwapEnabled = false,
            .isGenericEnabled = false,
            .isEndOfFramePulseEnabled = false,
            .isEndOfLinePulseEnabled = false,
            .isPayloadChecksumEnable = false,
            .isGenerateIntrEveryNumLinesForIntr = true,
            .transcodeConfig =
            {
                .transcodeFormat = CSIRX_TRANSCODE_FORMAT_NO_TRANSCODE,
                .isHorizontalDownscalingBy2Enabled = false,
                .crop =
                {
                    .horizontalCount = 0,
                    .horizontalSkip = 0,
                    .verticalCount = 0,
                    .verticalSkip = 0,
                },
            },
            .pingPongConfig =
            {
                .pingAddress = 0,
                .pongAddress = 0,
                .lineOffset = 0,
                .pingPongSwitchMode = CSIRX_PING_PONG_LINE_SWITCHING,
                .numFramesForFrameBasedPingPongSwitching = 1,
                .numLinesForLineBasedPingPongSwitching = 2,
            },
            .enableIntr =
            {
                .isNumLines = false,
                .isFramesToAcquire = false,
                .isPayloadChecksumMismatch = false,
                .isLineStartCodeDetect = false,
                .isLineEndCodeDetect = false,
                .isFrameStartCodeDetect = true,
                .isFrameEndCodeDetect = true,
                .isLongPacketOneBitErrorCorrect = false,
            },
            .eolCallback = NULL,
            .eolCallbackArgs = NULL,
        },
    };

    int32_t Drivers_csirxInstanceOpen(uint32_t instanceIduint16_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 && gCsirxPhyEnable[instanceId])
        {
            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)
            {
                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);
                }
            }
            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)
        {
            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)
        {
            /* 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 && gCsirxPhyEnable[instanceId])
        {
            /* 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)
        {
            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 interface */
            status = CSIRX_commonEnable(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_commonEnable failed !!!\r\n", instanceId);
            }
        }
        return status;
    }

    int32_t Drivers_csirxInstanceClose(uint32_t instanceIduint16_t numContexts)
    {
        uint32_t i;
        int32_t status = SystemP_SUCCESS;

        CSIRX_debugModeDisable(gCsirxHandle[instanceId]);

        for(i = 0; i < numContexts; i++)
        {
            /* enable context */
            status = CSIRX_contextDisable(gCsirxHandle[instanceId], i);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_contextDisable for context %d failed !!!\r\n", instanceId, i);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            /* enable interface */
            status = CSIRX_commonDisable(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_commonDisable failed !!!\r\n", instanceId);
            }
        }
        if(status==SystemP_SUCCESS)
        {
            status = CSIRX_close(gCsirxHandle[instanceId]);
            if(status!=SystemP_SUCCESS)
            {
                DebugP_logError("CSIRX %d: CSIRX_close failed !!!\r\n", instanceId);
            }
        }
        return status;
    }

    int32_t Drivers_csirxOpen()
    {
        int32_t status = SystemP_SUCCESS;

        if(status == SystemP_SUCCESS)
        {
            status = Drivers_csirxInstanceOpen(
                        CONFIG_CSIRX0,
                        CONFIG_CSIRX0_NUM_CONTEXT,
                        gConfigCsirx0ContextConfig
                );
        }

        return status;
    }

    int32_t Drivers_csirxClose()
    {
        int32_t status = SystemP_SUCCESS;

        if(status == SystemP_SUCCESS)
        {
            status = Drivers_csirxInstanceClose(
                        CONFIG_CSIRX0,
                        CONFIG_CSIRX0_NUM_CONTEXT
                        );
        }
        return status;
    }

    /*
     * EDMA
     */
    /* EDMA Driver handles */
    EDMA_Handle gEdmaHandle[CONFIG_EDMA_NUM_INSTANCES];

    /* EDMA Driver Open Parameters */
    EDMA_Params gEdmaParams[CONFIG_EDMA_NUM_INSTANCES] =
    {
        {
            .intrEnable = TRUE,
        },
        {
            .intrEnable = TRUE,
        },
    };

    void Drivers_edmaOpen(void)
    {
        uint32_t instCnt;
        int32_t  status = SystemP_SUCCESS;

        for(instCnt = 0U; instCnt < CONFIG_EDMA_NUM_INSTANCES; instCnt++)
        {
            gEdmaHandle[instCnt] = NULL;   /* Init to NULL so that we can exit gracefully */
        }

        /* Open all instances */
        for(instCnt = 0U; instCnt < CONFIG_EDMA_NUM_INSTANCES; instCnt++)
        {
            gEdmaHandle[instCnt] = EDMA_open(instCnt, &gEdmaParams[instCnt]);
            if(NULL == gEdmaHandle[instCnt])
            {
                DebugP_logError("EDMA open failed for instance %d !!!\r\n", instCnt);
                status = SystemP_FAILURE;
                break;
            }
        }

        if(SystemP_FAILURE == status)
        {
            Drivers_edmaClose();   /* Exit gracefully */
        }

        return;
    }

    void Drivers_edmaClose(void)
    {
        uint32_t instCnt;

        /* Close all instances that are open */
        for(instCnt = 0U; instCnt < CONFIG_EDMA_NUM_INSTANCES; instCnt++)
        {
            if(gEdmaHandle[instCnt] != NULL)
            {
                EDMA_close(gEdmaHandle[instCnt]);
                gEdmaHandle[instCnt] = NULL;
            }
        }

        return;
    }


    ============

    The result of my inspection is int the functin "CSIRX_complexioIsResetDone"   the  isResetDone set false.

    Description of Technical Manual the CSI2_CONPLEXIO_CFG[29] RESET_CTRL be set to 0x1 when CSI2_CONPLEXIO_CFG[30] RESET_CTRL set 0x1.

    When I run the program,the  CSI2_CONPLEXIO_CFG[29] RESET_CTRL always 0x0  when CSI2_CONPLEXIO_CFG[30] RESET_CTRL set 0x1.

    guilin.shi

  • Hello Saswat,

    Because our working hours are inconsistent,Can you tell me how to correctly configure the CSI2 module and inspection methods.

    Since this is the first time for me to configure the CSI2 module, I don't know if my configuration method is wrong.

    thanks!

    guilin.shi

  • Hi guilin.shi,

    Please do make the changes I have listed down step by step and then let me know if it works or not:|

    1) in the syscfg gui in the CSI Rx disable this particular option:

    2) you have pasted me the whole function in this thread
     int32_t Drivers_csirxInstanceOpen(uint32_t instanceIduint16_t numContexts, CSIRX_ContextConfig *pContextConfig)
    Here I need you to copy this function and name it as any function name(func1), then make the following changes in this particular command in this function:

    You have the CSIRX_complexioIsResetDone, remove that code and then add this modified code in the end of the Drivers_csirxInstanceOpen before the 
    return status. The modified code is:

    if(status==SystemP_SUCCESS)
            {
                bool isResetDone = false;

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

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


    3) Then add this function in any separate file (the header file directory will change based on where the sysconfig files are generated):

    #include <ti/demo/awr294x/mmw/mss/mssgenerated/ti_drivers_config.h>
    #include <ti/demo/awr294x/mmw/mss/mssgenerated/ti_board_config.h>
    #include <ti/demo/awr294x/mmw/mss/mssgenerated/ti_drivers_open_close.h>
    #include <ti/demo/awr294x/mmw/mss/mssgenerated/ti_board_open_close.h>
    #include <drivers/csirx.h>
    void 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,2,gConfigCsirx0ContextConfig);
    }

    4) Once you have done this, you will have to call this csifunc() in your main code after the 
    Board_driversOpen(); (it can be anywhere after this point, depending on your use case you can call it whenever you want to receive the CSI)
    Then rebuild this code and ensure that the separate file which has the function is also included in your application build.

    5) Then run the receiver code, then you should notice that it gets stuck in the resetDone loop, I have attached the loop for reference:
    do
                {
                    status = CSIRX_complexioIsResetDone(gCsirxHandle[instanceId], &isResetDone);
                    if(status!=SystemP_SUCCESS)
                    {
                        break;
                    }
                } while(isResetDone == false);
    And then when you enable the transmitter, it should break from this loop and go back to the main code. This ensures that your device is indeed receiving the code.

    Regards,
    Saswat Kumar
  • Hello Saswat,

    I change this step,it can break from this loop when i transmitter.

    but the interrupt callback function(App_csirxCommonCallback) not triggered。

    When i  send debug frame used function(CSIRX_debugModeGenerateFrames),the  interrupt callback function(App_csirxCommonCallback)  can triggered.

    Regards,

    guilin.shi

  • Hello Guillin Shi,

    Could you please explain when you are facing issue?
    What are you using as the Tx, what is the callback used for? and in which case are you not able to see it?

    Regards,
    Saswat Kumar

  • Hello Saswat,

    I want receive data from FPGA by csi2 mode.

    I running csirx example, the interrupt callback function(App_csirxCommonCallback)  can triggered when i send data by CSIRX_debugModeGenerateFrames function.

    I want the callback function can trigger when csi2 mode receive data.

    In this function ,i just record trigger count for let me know I got the data.

     

    Regards,

    guilin.shi

  • Hello shi guillin,

    Could you confirm whether the data you are receiving from the FPGA is getting populated in the AWR2944? Please do also let me know how you are confirming this step.

    Regards,
    Saswat Kumar

  • Hello Saswat,

    I can see the sent data through the FPGA debugger,and csi2 data lan clock lan will change.

    but I don't know whether the data is actually received and whether the data format matches correctly。

    Is there any way to confirm whether AWR2944 have received valid data?

     

    Regards,

    guilin.shi

  • Hello Shi Guillin,

    So, if you have written your custom application, you could select the ping/pong address for the CSI2 lines data to be received in the L3 for cross verification.
    If you are able to see our data there, that means the data is actually being streamed in the proper format.

    Regards,
    Saswat Kumar

  • Hello Saswat,

    I use the following code to set buff and context.

    ========

    uint8_t gAppBuf[2][APP_BUF_SIZE_MAX] __attribute__((aligned(64), section(".bss.dss_l3")));

     

    CSIRX_contextSetPingPongAddress(csirxHandle, contextId, (uint32_t)gAppBuf[0], (uint32_t)gAppBuf[1] );
    CSIRX_contextEnable(csirxHandle, contextId);

    ========

    The buff has data when when i send data by CSIRX_debugModeGenerateFrames function.

    But buff has't data when when i send data by FPGA.

    From FPGA  TX to AWR2944 RX, I don't know which module is the problem。

    Do you have any good inspection suggestions(Because I can see the waveform in data line and clock line,i think has data send to AWR2944)

    Regards,

    guilin.shi

  • Hello Shi Guilin

    .pingPongConfig =
            {
                .pingAddress = 0,
                .pongAddress = 0,
                .lineOffset = 0,
                .pingPongSwitchMode = CSIRX_PING_PONG_LINE_SWITCHING,
                .numFramesForFrameBasedPingPongSwitching = 1,
                .numLinesForLineBasedPingPongSwitching = 2,
            },

    Here you have set the pingpong config to address as 0. could you please modify this and then run, rebuild and let me know.

    Regards,
    Saswat Kumar

  • Hello Saswat,

    This problem has been solved,because the data format sent by FPGA is wrong(Frame start and Frame end not sent as expected).

    we can closed this case,Thank you for your support!!!

    Regards,

    guilin.shi

  • Hello Shi Guilin,

    No problem! 

    Regards,
    Saswat Kumar

  • Hello Saswat,

    I have another question,  can i change pingpong address when the program is running. 

    Regards,

    guilin.shi

  • Hello shi guillin,

    As this is on a different topic, could you open another thread and also do mention whether you are talking about the CSI ping/pong. 
    Closing this thread for keeping easier track.

    Regards,
    Saswat Kumar

  • Hello Saswat,

    How to close this thread ,i don't find the close button.

    Regards,

    guilin.shi

  • Hello shi guilin,

    I will close this thread.

    Regards,
    Saswat Kumar

  • Hello Saswat,

    ok, thanks!

    Regards,

    guilin.shi