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.

AWR1642: how to reconfiguration the register "FrameCfg" in the dss side

Part Number: AWR1642


hi 

i have some problem when i used the mmwave_demo code. I wanna reconfiguration the register "FrameCfg"  every frame in the dss side.

i trying to insert the code segment into the function "MmwDemo_dssFrameStartIntHandler"("C:\ti\mmwave_sdk_01_00_00_05\packages\ti\demo\xwr16xx\mmw\dss\dss_main.c").but it  got error.

would you please tell me what the error means and how to deal with it?

if this method is wrong , have some advice for the other ways?

code segment:

static void MmwDemo_dssFrameStartIntHandler(uintptr_t arg)
{
    int32_t errCode = 0;

    if(gMmwDssMCB.state == MmwDemo_DSS_STATE_STOPPED)
    {
        gMmwDssMCB.stats.frameIntSkipCounter++;
        return;
    }

    if(gMmwDssMCB.state == MmwDemo_DSS_STATE_STOP_PENDING)
    {
        /* stop the clock as the DSP will be stopped at the end of this active frame */
        Clock_stop(gMmwDssMCB.frameClkHandle);
    }

    if (errCode != RL_RET_CODE_OK)
    {
        /* Error: Setting the chirp configuration failed */
        System_printf ("Error: frame configuration error [Error code %d]\n", errCode);
    }

    /* Check if previous chirp processing has completed */
    DebugP_assert(gMmwDssMCB.dataPathObj.interFrameProcToken == 0);

    gMmwDssMCB.dataPathObj.interFrameProcToken++;

    /* Increment interrupt counter for debugging purpose */
    gMmwDssMCB.stats.frameStartIntCounter++;

    /* reconfiguration the frame */
    errCode = rlSensorStop (RL_DEVICE_MAP_INTERNAL_BSS);

    if (errCode != RL_RET_CODE_OK)
    {
        System_printf ("Debug : sensor stop error\n");
    }

    gframeCfg.chirpStartIdx        = 0;
    gframeCfg.chirpEndIdx          = 511;
    gframeCfg.numLoops             = 1;
    gframeCfg.numFrames            = 0;
    gframeCfg.framePeriodicity     = 100 * 1000000 / 5;
    gframeCfg.triggerSelect        = 1; //Software API based triggering
    gframeCfg.frameTriggerDelay    = 0 * 1000000 / 5;

    errCode = rlSetFrameConfig(RL_DEVICE_MAP_INTERNAL_BSS, &gframeCfg);
    if (errCode != RL_RET_CODE_OK)
    {
        System_printf ("Debug : frame configuration error\n");
    }

    errCode = rlSensorStart (RL_DEVICE_MAP_INTERNAL_BSS);
    if (errCode != RL_RET_CODE_OK)
    {
        System_printf ("Debug : sensor start error\n");
    }


    /* Post event to notify frame start interrupt */
    Event_post(gMmwDssMCB.eventHandle, MMWDEMO_FRAMESTART_EVT);
}

the error shows as below:

pic1 : 

pic2: 

pic3 : 

pic4:

pic5 : 

BR

Havi

  • Hello Havi,

    We will get back to you with the right point in the code to introduce this change. Typically Master Sub System carries out such control oriented task and DSP side.
    FOr reference can you please attached the modified C code if at all the expert would need to try out the run before responding back.

    At this point the error could because of improper place to introduce this change or could be because the modified config is incorrect.

    Thank you,
    Vaibhav
  • Hello Havi,

    As per your error snapshots, looks like rlSensorStop is not going through.

    Few things you need to take care while doing this experiment

    • Don't call any time-consuming API from interrupt handler function (here MmwDemo_dssFrameStartIntHandler)
    • Whenever you are calling rlSensorStop, RadarSS stops frame only after the current ongoing frame is being done.
    • So, next time you need to start frame (rlSensorStart) only when you get chirp interrupt  ('gMmwDssMCB.stats.chirpIntCounter') equal to total number of chirps configured.

    • To Stop the frame, reconfiguration and start frame you need to add your API calls under 'MmwDemo_dssDataPathTask' function.

    if(event & MMWDEMO_CHIRP_EVT)
    {

    MmwDemo_dssDataPathProcessEvents(..)

    /* rlSensorStop, rlSetFrameConfig , rlSensorStart */

    Regards,

    Jitendra Gupta

  • Jitendra,

    I tried your suggestion, but I met frameconfig error with below code. Would you pls kindly advise what is missed?

    if(event & MMWDEMO_CHIRP_EVT)
    {
    if((gMmwDssMCB.state == MmwDemo_DSS_STATE_STARTED) || (gMmwDssMCB.state == MmwDemo_DSS_STATE_STOP_PENDING))
    {
    if ((retVal = MmwDemo_dssDataPathProcessEvents(MMWDEMO_CHIRP_EVT)) < 0 )
    {
    System_printf ("Error: MMWDemoDSS Data Path process chirp event failed with Error[%d]\n",
    retVal);
    }
    }
    //add by chris for test

    retVal = rlSensorStop(RL_DEVICE_MAP_INTERNAL_BSS);
    if (retVal != 0)
    {
    System_printf ("Error: Unable to stop Sensor [Error %d]\n", retVal);
    goto exit;
    }

    retVal = rlSetFrameConfig(RL_DEVICE_MAP_INTERNAL_BSS, &gMmwDssMCB.cfg.ctrlCfg.u.fullControlCfg.u.chirpModeCfg.frameCfg);
    if (retVal != 0)
    {
    System_printf ("Error: Unable to set frameconfig [Error %d]\n", retVal);
    goto exit;
    }

    rlSensorStart (RL_DEVICE_MAP_INTERNAL_BSS);
    System_printf ("DSP: rlSensorStart time: [%d us]\n", t2/DSP_CLOCK_MHZ);
    if (retVal != 0)
    {
    System_printf ("Error: Unable to start Sensor [Error %d]\n", retVal);
    goto exit;
    }
    //--------------------------------------

    }
  • hi Chris

    reconfigure the framecfg will take too much long time, it needs be shut down the radar senor and mss datapath and dss data path,so ,in my project.
    i just reconfigure the chirp parameter, cuz the chirp parameter is just store in the ram, rewrite the ram , means reconfigure the chirp paramter.
    and it do not need to shut down the senor ,and datapath .

    br
    havi
  • Hello Chris,
    What is the error code you are getting while calling rlSetFrameConfig API?

    And if you are changing numOfChirp and numAdcSample in frameConfig then you need to take care of re-configuring dataPath also based on these new parameters.

    Regards,
    Jitendra Gupta
  • Due to inactivity for long time we are closing this thread. Please reply back if you have any further query which will re-open this thread.


    Regards,
    Jitendra