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.

IWR6843ISK: gesture example running on IWR6843ISK

Part Number: IWR6843ISK
Other Parts Discussed in Thread: AWR6843ISK

Tool/software:

hi josh,

  my requirement also  running "Gesture_with_Machine_Learning demo " with AWR6843ISK EVM.

I have attached AWR6843ISK EVM mimo antenna array for reference:

the below code are taken from "C:\ti\radar_toolbox_1_30_01_03\source\ti\examples\Gesture_Recognition\Gesture_with_Machine_Learning\src\6443\mss\gesture.c file provided part of example design.

void Computefeatures_DOABased(void)
{
uint32_t *ptr;
cmplx32ImRe_t *DOA_Input_ptr;
int16_t rangeIdx, dopplerIdx;
cmplx32ImRe_t DOA_Input[gfeatures.numVirtualAntennas * 2]; // Need to account for the fact that there are 4 physical RX channels

/* Now find the largest value in the detection matrix in the first RANGE_BIN_END of range bins according to the MATLAB model
*
* In this target code, there are:
* 64 range bins
* 128 Doppler bins
*
* Search through the first RANGE_BIN_END range bins and across all Doppler bins
*/
gfeatures.rangeIndex = 0;
gfeatures.dopplerIndex = 0;
ptr = gfeatures.detMatrixData;
gfeatures.max_value_ptr = ptr;
for (rangeIdx = 0; rangeIdx < RANGE_BIN_END; rangeIdx++)
{
for (dopplerIdx = 0; dopplerIdx < gfeatures.numDopplerBins; dopplerIdx++)
{
if (*ptr > *gfeatures.max_value_ptr)
{
gfeatures.max_value_ptr = ptr;
gfeatures.rangeIndex = rangeIdx;
gfeatures.dopplerIndex = dopplerIdx;
}
ptr++;
}
}

gfeatures.currentWeight = (float)*gfeatures.max_value_ptr;

/* Use the range index and doppler index values to navigate to the location of 2D FFT Output samples */
DOA_Input_ptr = gfeatures.dopplerCubeData;
DOA_Input_ptr += (gfeatures.rangeIndex * gfeatures.numDopplerBins * gfeatures.numVirtualAntennas) +
(gfeatures.dopplerIndex * gfeatures.numVirtualAntennas);

/* Create an array for the 2D Input
* Since there are 4 physical RX channels on this device, this needs to be accounted for in the virtual samples array
* RX1 and RX4 values need to be multiplied by -1 to account for 180 degree phase difference between RX1 and RX2
* Also need to take into consideration the fact that the RX1 virtual antennas are separated by a factor of lamba and not lambda/2
*
* 2D FFT Data is organized in the following manner:
* [ 0 1 2 3 ]
* [TX1-RX1 TX1-RX2 TX1-RX3 TX1-RX4]
*
* Input data for the angle calculation will be organized in the following manner:
* [0 1 2 3 4 5 6 7]
* [TX1-RX1 TX1-RX2 TX1-RX4 TX1-RX3 0 0 0 0]
*
* This simplifies the HWA paramset set implementation since HWA can only zero pad and not zero fill
*
*/

#if defined(MMW_6843_ODS)
/* Populate DOA_Input with the four input samples from the 2D FFT Output */
// TX1-RX1
DOA_Input[0] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX2
DOA_Input[1] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX3
DOA_Input[3] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX4
DOA_Input[2] = *DOA_Input_ptr;

/* Apply the Phase Correction coefficient to the RX1 and RX4 values */
/* The 6843 ODS Antenna has RX1 and RX4 fed from the opposite side so all
* corresponding virtual RXs channels need to be inverted by 180 degrees
*/
// TX1-RX1
DOA_Input[0].imag *= PHASE_CORRECTION;
DOA_Input[0].real *= PHASE_CORRECTION;
// TX1-RX4
DOA_Input[2].imag *= PHASE_CORRECTION;
DOA_Input[2].real *= PHASE_CORRECTION;

/* Scale the 2D FFT input values down by 2^6 (64) */
// TX1-RX1
DOA_Input[0].imag = DOA_Input[0].imag / 64;
DOA_Input[0].real = DOA_Input[0].real / 64;
// TX1-RX2
DOA_Input[1].imag = DOA_Input[1].imag / 64;
DOA_Input[1].real = DOA_Input[1].real / 64;
// TX1-RX3
DOA_Input[3].imag = DOA_Input[3].imag / 64;
DOA_Input[3].real = DOA_Input[3].real / 64;
// TX1-RX4
DOA_Input[2].imag = DOA_Input[2].imag / 64;
DOA_Input[2].real = DOA_Input[2].real / 64;

/* Fill in the remaining values */
// TX2-RX1
DOA_Input[4].imag = 0;
DOA_Input[4].real = 0;
// TX2-RX2
DOA_Input[5].imag = 0;
DOA_Input[5].real = 0;
// TX2-RX3
DOA_Input[7].imag = 0;
DOA_Input[7].real = 0;
// TX2-RX4
DOA_Input[6].imag = 0;
DOA_Input[6].real = 0;
#endif

#if defined(MMW_6843_AOP)
/* Populate DOA_Input with the four input samples from the 2D FFT Output */
// TX1-RX1
DOA_Input[3] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX2
DOA_Input[2] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX3
DOA_Input[1] = *DOA_Input_ptr;
DOA_Input_ptr++;
// TX1-RX4
DOA_Input[0] = *DOA_Input_ptr;

/* Apply the Phase Correction coefficient to the RX2 and RX4 values */
/* The 6843 AOP Antenna has RX1 and RX3 fed from the opposite side so all
* corresponding virtual RXs channels need to be inverted by 180 degrees
*/
// TX1-RX1
DOA_Input[0].imag *= PHASE_CORRECTION;
DOA_Input[0].real *= PHASE_CORRECTION;
// TX1-RX3
DOA_Input[2].imag *= PHASE_CORRECTION;
DOA_Input[2].real *= PHASE_CORRECTION;

/* Scale the 2D FFT input values down by 2^6 (64) */
// TX1-RX1
DOA_Input[3].imag = DOA_Input[3].imag / 64;
DOA_Input[3].real = DOA_Input[3].real / 64;
// TX1-RX2
DOA_Input[2].imag = DOA_Input[2].imag / 64;
DOA_Input[2].real = DOA_Input[2].real / 64;
// TX1-RX3
DOA_Input[1].imag = DOA_Input[1].imag / 64;
DOA_Input[1].real = DOA_Input[1].real / 64;
// TX1-RX4
DOA_Input[0].imag = DOA_Input[0].imag / 64;
DOA_Input[0].real = DOA_Input[0].real / 64;

/* Fill in the remaining values */
// TX2-RX1
DOA_Input[4].imag = 0;
DOA_Input[4].real = 0;
// TX2-RX2
DOA_Input[5].imag = 0;
DOA_Input[5].real = 0;
// TX2-RX3
DOA_Input[7].imag = 0;
DOA_Input[7].real = 0;
// TX2-RX4
DOA_Input[6].imag = 0;
DOA_Input[6].real = 0;
#endif

/* Transfer DOA_Input samples to HWA Memory Bank M0 and prepare to execute HWA paramsets*/
memcpy((void *)gfeatures.HWA_base_address, (void *)&DOA_Input, sizeof(DOA_Input));

/* Zero out the selected index in the detection matrix for the next loop */
// gfeatures.detMatrixData[max_value_index] = 0;
*gfeatures.max_value_ptr = 0;
}

my question:

1. can you tell me , code changes required inside "void Computefeatures_DOABased(void)" function for AWR6843ISK EVM(as you mentioned all the three TX antennas are enabled to generate the above Virtual array pattern)

Regards,

mani

  • Hi,

    We are looking into your query. Please allow us a couple of days to respond.

    Regards,

    Sharan

  • Hi Mani, 

    The Computefeatures_DOABased function arranges the input samples for the angle FFTs and because of the differences of the antenna design across the EVMs this needs to be updated.

    You can see in the code the statements like #if defined(MMW_6843_ODS) and #if defined(MMW_6843_AOP). I suggest creating a section like #if defined(MMW_6843_ISK) and inside you will need to populate the DOA_Input array with the 2D FFT data in the correct order. For ISK EVM you would not need to apply the PHASE_CORRECTION part because all of the antennas are fed from the same direction on that EVM.

    Best Regards,

    Josh

  • Hi Josh,

    Thanks for your reply. I understand your recommendations. 

    My question:

    1.can add  necessary changes required for AWR6843ISK, inside the #if defined (MMW_6843_ODS) itself rather than creating  one more  #defined (MMW_6843_ISK)..in that case will the code work without any issue for AWR6843ISK?

    2.where can I find (which header file) these MMW_6843_ODS and MMW_6843_AOP statements are declaRegards 

    Regards, 

    MANI

  • Hi Mani, 

    .can add  necessary changes required for AWR6843ISK, inside the #if defined (MMW_6843_ODS) itself rather than creating  one more  #defined (MMW_6843_ISK)..in that case will the code work without any issue for AWR6843ISK?

    Yes that could also work. If you did that then you could comment out the phase correction part as that should not be needed with ISK and you would need to change the first part where DOA_Input is filled with values from DOA_Input_ptr accordingly.

    where can I find (which header file) these MMW_6843_ODS and MMW_6843_AOP statements are declaRegards 

    These statements are not defined in a header file but rather specified as predefined symbols in the .projectspec file for the example project. (radar_toolbox_2_20_00_05\source\ti\examples\Gesture_Recognition\Gesture_with_Machine_Learning\src\6443\gesture_ML_6443_ODS.projectspec)

    Best Regards,

    Josh

  • hi josh,

     thanks for your quick response.

     i have done code changes as you suggested and attached here for reference:

      change 1:

     inside the  \ti\radar_toolbox_1_30_01_03\source\ti\examples\Gesture_Recognition\Gesture_with_Machine_Learning\src\6443\mss\cli.c file  and

    to enable Two transmit antenna transmission changes added inside the  code block "char *hardCodedConfigCommands[] = { } ;  

        "channelCfg 15 3 0",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg 0 1 128 0 35 1 0",

      change 2: file "C:\ti\radar_toolbox_1_30_01_03\source\ti\examples\Gesture_Recognition\Gesture_with_Machine_Learning\src\6443\mss\gesture.c"

    existing #if defined(MMW_6843_ODS) code block is replaced with following code

    #if defined(MMW_6843_ODS)
    /* Populate DOA_Input with the four input samples from the 2D FFT Output */

    DOA_Input_ptr++;
    DOA_Input_ptr++;

    // TX1-RX3
    DOA_Input[1] = *DOA_Input_ptr;
    DOA_Input_ptr++;
    // TX1-RX4
    DOA_Input[3] = *DOA_Input_ptr;
    DOA_Input_ptr++;
    // TX2-RX1
    DOA_Input[0] = *DOA_Input_ptr;
    DOA_Input_ptr++;
    // TX2-RX2
    DOA_Input[2] = *DOA_Input_ptr;

    /* Scale the 2D FFT input values down by 2^6 (64) */
    // TX1-RX3
    DOA_Input[1].imag = DOA_Input[1].imag / 64;
    DOA_Input[1].real = DOA_Input[1].real / 64;
    // TX1-RX4
    DOA_Input[3].imag = DOA_Input[3].imag / 64;
    DOA_Input[3].real = DOA_Input[3].real / 64;
    // TX2-RX1
    DOA_Input[0].imag = DOA_Input[0].imag / 64;
    DOA_Input[0].real = DOA_Input[0].real / 64;
    // TX2-RX2
    DOA_Input[2].imag = DOA_Input[2].imag / 64;
    DOA_Input[2].real = DOA_Input[2].real / 64;

    /* Fill in the remaining values */

    DOA_Input[4].imag = 0;
    DOA_Input[4].real = 0;

    DOA_Input[5].imag = 0;
    DOA_Input[5].real = 0;

    DOA_Input[7].imag = 0;
    DOA_Input[7].real = 0;

    DOA_Input[6].imag = 0;
    DOA_Input[6].real = 0;


    #endif

    please check the above changes and give your commennts.

    Regards,

    mani

           

             

  • please also confirm which one is correct chirp comment for two tx antenna case:

        "channelCfg 15 3 0",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg 0 1 128 0 35 1 0",

                or 

         "channelCfg 15 3 0",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg 0 0 128 0 35 1 0",

    regards,

    Mani

  • sorry,i forget to add antenna pattern realized with two Transmit antenna in previous message and attached here.

      

    i have done the mapping of DOA_Input  referring above antenna pattern.

    Regards,

    Mani

  • Hi Mani, 

    I believe the changes you showed should properly map the DOA_input values for the highlighted virtual antennas. 

    Regarding the configuration commands for the two tx antenna case, "frameCfg 0 1 128 0 35 1 0" should be correct. 

    BEst Regards,

    Josh

  • hi josh,

     thanks for your reply.

    we have tested the modified code for the following two cases:

    test case 1:chirp setting(which uses only one TX antenna (not two Tx ant)

       "channelCfg 15 3 0",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg0 128 0 35 1 0",

    Gestures are working for the following cases:

    1.Right to Left Swipe 2.Left to Right Swipe 3.On Gesture 4.Off Gesture5.Shine Gesture

    Gestures are Not working  for the following cases:

    6.Clockwise Twirl- works sometime

    7.Counterclockwise Twirl- works sometime

    8.Up to Down Swipe - not working
    9.Down to Up Swipe -not working

    test case 2:chirp setting(which uses Two Tx antenna)

        "channelCfg 15 3 0",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg 0 1 128 0 35 1 0",

    error message on visualiser:" we are not getting any data on the com port"

    My question:

      please check and confirm, any other places further code modification is required  or existing code changes are not enough to work for all the 9 gestures on AWR6843ISK?

    Regards,

    mani

       

     

  • Hi Mani, 

    Thanks for the summary, it is very helpful.

    I think for test case 1 this behavior is expected. Since the ISK antenna is used and only one Tx is enabled then the resulting virtual antenna pattern provides no elevation information which is required for classifying the up and down swipe gestures. 

    For test case 2, theoretically the changes you have made should be enough but it seems there may be some other reason or another change required to get it working. In your testing so far have you just been flashing the board with the compiled binary image and testing with the visualizer? Can you please try running the demo in debug mode while connected to the device from CCS (instructions here)? This would allow you to see more helpful debug information such as if/where the code is crashing. 

    Best Regards,

    Josh

  • hi josh,

     thanks for your reply.

    AS you suggested ,i will check with debug mode ,

    As for my understanding gesture application example  is created using 6843ODD demo processing chain with adding additional gesture logic.

    I have compared  src files of 6843(ODD) with gesture src files and its observed most of the changes made inside the 

    "C:\ti\radar_toolbox_1_30_01_03\source\ti\examples\Gesture_Recognition\Gesture_with_Machine_Learning\src\6443\include\dopplerproc\src\dopplerprochwa.c" and inside the following function:

     1.  int32_t DPU_DopplerProcHWA_configHwa();

      2. int32_t DPU_DopplerProcHWA_configEdma()
     3.int32_t DPU_DopplerProcHWA_config()
     4.DPU_DopplerProcHWA_Handle DPU_DopplerProcHWA_init()

      5. int32_t DPU_DopplerProcHWA_process()  ---> Gesture related functions are called inside it.

    i request you to look into these function ,logics and suggest me any changes require here to make example work for all gesture conditions on AWR6843ISK?

    regards,

    Mani

  • i have attached src code of two function here( and DPU_DopplerProcHWA_process())  for your quick reference and is marked with red(these lines are additional codes compared to 6443 ODD demo src file.

    1.DPU_DopplerProcHWA_config()


    int32_t DPU_DopplerProcHWA_config(
    DPU_DopplerProcHWA_Handle handle,
    DPU_DopplerProcHWA_Config *cfg)
    {
    DPU_DopplerProcHWA_Obj *obj;
    int32_t retVal = 0;
    uint16_t expectedWinSamples;


    obj = (DPU_DopplerProcHWA_Obj *)handle;
    if (obj == NULL)
    {
    retVal = DPU_DOPPLERPROCHWA_EINVAL;
    goto exit;
    }

    #if DEBUG_CHECK_PARAMS
    /* Validate params */
    if (!cfg ||
    !cfg->hwRes.edmaCfg.edmaHandle ||
    !cfg->hwRes.hwaCfg.window ||
    !cfg->hwRes.radarCube.data ||
    !cfg->hwRes.detMatrix.data)
    {
    retVal = DPU_DOPPLERPROCHWA_EINVAL;
    goto exit;
    }

    /* Check if radar cube format is supported by DPU*/
    if (cfg->hwRes.radarCube.datafmt != DPIF_RADARCUBE_FORMAT_1)
    {
    retVal = DPU_DOPPLERPROCHWA_ECUBEFORMAT;
    goto exit;
    }

    /* Check if detection matrix format is supported by DPU*/
    if (cfg->hwRes.detMatrix.datafmt != DPIF_DETMATRIX_FORMAT_1)
    {
    retVal = DPU_DOPPLERPROCHWA_EDETMFORMAT;
    goto exit;
    }

    /* Check if radar cube column fits into one HWA memory bank */
    if ((cfg->staticCfg.numTxAntennas * cfg->staticCfg.numRxAntennas *
    cfg->staticCfg.numDopplerChirps * sizeof(cmplx16ImRe_t)) > (SOC_HWA_MEM_SIZE / SOC_HWA_NUM_MEM_BANKS))
    {
    retVal = DPU_DOPPLERPROCHWA_EEXCEEDHWAMEM;
    goto exit;
    }

    /* Check if abs value of log2 of 2D FFT fits in one HWA memory bank */
    if ((cfg->staticCfg.numTxAntennas * cfg->staticCfg.numRxAntennas *
    cfg->staticCfg.numDopplerBins * sizeof(uint16_t)) > (SOC_HWA_MEM_SIZE / SOC_HWA_NUM_MEM_BANKS))
    {
    retVal = DPU_DOPPLERPROCHWA_EEXCEEDHWAMEM;
    goto exit;
    }

    /* Check if number of range bins is even*/
    if ((cfg->staticCfg.numRangeBins % 2) != 0)
    {
    retVal = DPU_DOPPLERPROCHWA_EINVAL;
    goto exit;
    }

    /* Check if detection matrix size is sufficient*/
    if (cfg->hwRes.detMatrix.dataSize < (cfg->staticCfg.numRangeBins *
    cfg->staticCfg.numDopplerBins * sizeof(uint16_t)))
    {
    retVal = DPU_DOPPLERPROCHWA_EDETMSIZE;
    goto exit;
    }

    /* Check window Size */
    if (cfg->hwRes.hwaCfg.winSym == HWA_FFT_WINDOW_NONSYMMETRIC)
    {
    expectedWinSamples = cfg->staticCfg.numDopplerChirps;
    }
    else
    {
    /* odd samples have to be rounded up per HWA */
    expectedWinSamples = (cfg->staticCfg.numDopplerChirps + 1) / 2;
    }

    if (cfg->hwRes.hwaCfg.windowSize != expectedWinSamples * sizeof(int32_t))
    {
    retVal = DPU_DOPPLERPROCHWA_EWINDSIZE;
    goto exit;
    }
    #endif

    /* Save necessary parameters to DPU object that will be used during Process time */

    /* EDMA parameters needed to trigger first EDMA transfer*/
    obj->edmaHandle = cfg->hwRes.edmaCfg.edmaHandle;
    memcpy((void *)(&obj->edmaIn), (void *)(&cfg->hwRes.edmaCfg.edmaIn), sizeof(DPU_DopplerProc_Edma));

    /*HWA parameters needed for the 2D FFT HWA common configuration*/
    obj->hwaNumLoops = cfg->staticCfg.numRangeBins / 2U;
    obj->hwaParamStartIdx = cfg->hwRes.hwaCfg.paramSetStartIdx;
    obj->hwaParamStopIdx = cfg->hwRes.hwaCfg.paramSetStartIdx + DPU_DOPPLERPROCHWA_NUM_HWA_PARAMSET_2D_FFT - 1;

    /*HWA parameters needed for the DoA HWA common configuration*/
    obj->hwaDoANumLoops = 1;
    obj->hwaDoAParamStartIdx = cfg->hwRes.hwaCfg.paramSetStartIdx + DPU_DOPPLERPROCHWA_NUM_HWA_PARAMSET_2D_FFT;
    obj->hwaDoAParamStopIdx = cfg->hwRes.hwaCfg.paramSetStartIdx + cfg->hwRes.hwaCfg.numParamSets - 1;


    /* Disable the HWA */
    retVal = HWA_enable(obj->hwaHandle, 0);
    if (retVal != 0)
    {
    goto exit;
    }

    /* HWA window configuration */
    retVal = HWA_configRam(obj->hwaHandle,
    HWA_RAM_TYPE_WINDOW_RAM,
    (uint8_t *)cfg->hwRes.hwaCfg.window,
    cfg->hwRes.hwaCfg.windowSize, // size in bytes
    cfg->hwRes.hwaCfg.winRamOffset * sizeof(int32_t));
    if (retVal != 0)
    {
    goto exit;
    }

    /*******************************/
    /** Configure HWA **/
    /*******************************/
    /*Compute source DMA channels that will be programmed in both HWA and EDMA.
    The DMA channels are set to be equal to the paramSetIdx used by HWA*/
    /* Ping DMA channel (Ping uses the first paramset)*/
    obj->hwaDmaTriggerSourcePing = cfg->hwRes.hwaCfg.paramSetStartIdx;
    /* Pong DMA channel*/
    obj->hwaDmaTriggerSourcePong = cfg->hwRes.hwaCfg.paramSetStartIdx + cfg->staticCfg.numTxAntennas + 1;
    retVal = DPU_DopplerProcHWA_configHwa(obj, cfg);
    if (retVal != 0)
    {
    goto exit;
    }

    /*******************************/
    /** Configure EDMA **/
    /*******************************/
    retVal = DPU_DopplerProcHWA_configEdma(obj, cfg);
    if (retVal != 0)
    {
    goto exit;
    }

    gfeatures.radarCubeData = (cmplx32ImRe_t *)cfg->hwRes.radarCube.data;

    /* Provide inputs for RDI Based calculations */
    gfeatures.numRangeBins = cfg->staticCfg.numRangeBins;
    gfeatures.numDopplerBins = cfg->staticCfg.numDopplerBins;
    gfeatures.detMatrixData = (uint32_t *)cfg->hwRes.detMatrix.data;

    /* Provide inputs for DOA Based calculations */
    gfeatures.dopplerCubeData = (cmplx32ImRe_t *)cfg->hwRes.dopplerCube.data;
    gfeatures.numVirtualAntennas = cfg->staticCfg.numVirtualAntennas;

    /* Provide pointer to the angle handle */
    gfeatures.angleMatrixData = (uint32_t *)cfg->hwRes.detMatrix.data + (gfeatures.numDopplerBins * gfeatures.numRangeBins);

    exit:
    return retVal;
    }

    2.DPU_DopplerProcHWA_process()

    int32_t DPU_DopplerProcHWA_process(
    DPU_DopplerProcHWA_Handle handle,
    DPU_DopplerProcHWA_OutParams *outParams)
    {
    volatile uint32_t startTime;
    DPU_DopplerProcHWA_Obj *obj;
    int32_t retVal = 0;
    bool status;
    HWA_CommonConfig hwaCommonConfig;
    uint8_t counter_DOA;
    float currentWeight_DOA;
    float wtSum_DOA;
    float wtMeanAzimuth_DOA, wtMeanElevation_DOA;
    float wtAzimuthSquared_DOA, wtElevationSquared_DOA;
    uint8_t i;

    obj = (DPU_DopplerProcHWA_Obj *)handle;
    if (obj == NULL)
    {
    retVal = DPU_DOPPLERPROCHWA_EINVAL;
    goto exit;
    }
    /* Set inProgress state */
    obj->inProgress = true;

    startTime = Cycleprofiler_getTimeStamp();

    /**********************************************/
    /* ENABLE NUMLOOPS DONE INTERRUPT FROM HWA */
    /**********************************************/
    retVal = HWA_enableDoneInterrupt(obj->hwaHandle,
    DPU_DopplerProcHWA_hwaDoneIsrCallback,
    obj->hwaDoneSemaHandle);
    if (retVal != 0)
    {
    goto exit;
    }

    /***********************/
    /* HWA COMMON CONFIG */
    /***********************/
    memset((void *)&hwaCommonConfig, 0, sizeof(HWA_CommonConfig));

    /* Config Common Registers */
    hwaCommonConfig.configMask =
    HWA_COMMONCONFIG_MASK_NUMLOOPS |
    HWA_COMMONCONFIG_MASK_PARAMSTARTIDX |
    HWA_COMMONCONFIG_MASK_PARAMSTOPIDX |
    HWA_COMMONCONFIG_MASK_FFT1DENABLE |
    HWA_COMMONCONFIG_MASK_INTERFERENCETHRESHOLD;

    hwaCommonConfig.numLoops = obj->hwaNumLoops;
    hwaCommonConfig.paramStartIdx = obj->hwaParamStartIdx;
    hwaCommonConfig.paramStopIdx = obj->hwaParamStopIdx;
    hwaCommonConfig.fftConfig.fft1DEnable = HWA_FEATURE_BIT_DISABLE;
    hwaCommonConfig.fftConfig.interferenceThreshold = 0xFFFFFF;

    retVal = HWA_configCommon(obj->hwaHandle, &hwaCommonConfig);
    if (retVal != 0)
    {
    goto exit;
    }

    /* Enable the HWA */
    retVal = HWA_enable(obj->hwaHandle, 1);
    if (retVal != 0)
    {
    goto exit;
    }

    EDMA_startTransfer(obj->edmaHandle, obj->edmaIn.ping.channel, EDMA3_CHANNEL_TYPE_DMA);
    EDMA_startTransfer(obj->edmaHandle, obj->edmaIn.pong.channel, EDMA3_CHANNEL_TYPE_DMA);

    /**********************************************/
    /* WAIT FOR HWA NUMLOOPS INTERRUPT */
    /**********************************************/
    status = SemaphoreP_pend(obj->hwaDoneSemaHandle, SemaphoreP_WAIT_FOREVER);

    if (status != SemaphoreP_OK)
    {
    retVal = DPU_DOPPLERPROCHWA_ESEMASTATUS;
    goto exit;
    }

    HWA_disableDoneInterrupt(obj->hwaHandle);

    /* Disable the HWA */
    retVal = HWA_enable(obj->hwaHandle, 0);
    if (retVal != 0)
    {
    goto exit;
    }

    /**********************************************/
    /* WAIT FOR EDMA DONE INTERRUPT */
    /**********************************************/
    status = SemaphoreP_pend(obj->edmaDoneSemaHandle, SemaphoreP_WAIT_FOREVER);
    if (status != SemaphoreP_OK)
    {
    retVal = DPU_DOPPLERPROCHWA_ESEMASTATUS;
    goto exit;
    }

    outParams->stats.numProcess++;
    outParams->stats.processingTime = Cycleprofiler_getTimeStamp() - startTime;

    /* Reset local variables used in DoA calculations */
    currentWeight_DOA = wtSum_DOA = wtMeanAzimuth_DOA = wtMeanElevation_DOA = wtAzimuthSquared_DOA = wtElevationSquared_DOA = 0;

    gfeatures.frameCount += 1;

    /* Clear the Doppler Bins around the 0th Doppler Bin for the Kick-to-Open Processing Chain */
    Computefeatures_preStart();

    /* Procedure for calculating the RDI Based Features from the Detection Matrix for the Kick-to-Open Processing Chain */
    Computefeatures_RDIBased();
    gfeatures.countDOA = 0;

    /* Prepare HWA to execute paramsets for DoA Based Features - this will run 50 times */
    for (counter_DOA = 0; counter_DOA < NUM_SORTED_VALUES; counter_DOA++)
    {
    /* Find the range and Doppler index for the largest value in the detection matrix
    * Copy the 2D FFT values for this index to the HWA to execute Angle FFT */
    Computefeatures_DOABased();

    gfeatures.countDOA += 1;
    /**********************************************/
    /* ENABLE NUMLOOPS DONE INTERRUPT FROM HWA */
    /**********************************************/
    retVal = HWA_enableDoneInterrupt(obj->hwaHandle,
    DPU_DopplerProcHWA_hwaDoneIsrCallback,
    obj->hwaDoneSemaHandle);
    if (retVal != 0)
    {
    goto exit;
    }

    /***********************/
    /* HWA COMMON CONFIG */
    /***********************/
    memset((void *)&hwaCommonConfig, 0, sizeof(HWA_CommonConfig));

    /* Config Common Registers */
    hwaCommonConfig.configMask =
    HWA_COMMONCONFIG_MASK_NUMLOOPS |
    HWA_COMMONCONFIG_MASK_PARAMSTARTIDX |
    HWA_COMMONCONFIG_MASK_PARAMSTOPIDX |
    HWA_COMMONCONFIG_MASK_FFT1DENABLE |
    HWA_COMMONCONFIG_MASK_INTERFERENCETHRESHOLD;

    hwaCommonConfig.numLoops = obj->hwaDoANumLoops;
    hwaCommonConfig.paramStartIdx = obj->hwaDoAParamStartIdx;
    hwaCommonConfig.paramStopIdx = obj->hwaDoAParamStopIdx;
    hwaCommonConfig.fftConfig.fft1DEnable = HWA_FEATURE_BIT_DISABLE;
    hwaCommonConfig.fftConfig.interferenceThreshold = 0xFFFFFF;

    retVal = HWA_configCommon(obj->hwaHandle, &hwaCommonConfig);
    if (retVal != 0)
    {
    goto exit;
    }

    /* Enable the HWA */
    retVal = HWA_enable(obj->hwaHandle, 1);
    if (retVal != 0)
    {
    goto exit;
    }

    /* Kick off the HWA paramsets with a software trigger */
    HWA_setSoftwareTrigger(obj->hwaHandle);

    /**********************************************/
    /* WAIT FOR HWA NUMLOOPS INTERRUPT */
    /**********************************************/
    status = SemaphoreP_pend(obj->hwaDoneSemaHandle, SemaphoreP_WAIT_FOREVER);

    if (status != SemaphoreP_OK)
    {
    retVal = DPU_DOPPLERPROCHWA_ESEMASTATUS;
    goto exit;
    }

    HWA_disableDoneInterrupt(obj->hwaHandle);

    /* Disable the HWA */
    retVal = HWA_enable(obj->hwaHandle, 0);
    if (retVal != 0)
    {
    goto exit;
    }

    /* Find the azimuth and elevation index for the largest value in the resulting angle matrix */
    ComputeAngleStats();

    /* Obtain the current weight from the detection matrix */
    currentWeight_DOA = gfeatures.currentWeight;

    /* Accumulate the total weight */
    wtSum_DOA += currentWeight_DOA;

    /* Accumulate the weighted values for the azimuth and elevation angles */
    wtMeanAzimuth_DOA += (gfeatures.azimuthIndex * currentWeight_DOA);
    wtMeanElevation_DOA += (gfeatures.elevationIndex * currentWeight_DOA);
    wtAzimuthSquared_DOA += (gfeatures.azimuthIndex * gfeatures.azimuthIndex * currentWeight_DOA);
    wtElevationSquared_DOA += (gfeatures.elevationIndex * gfeatures.elevationIndex * currentWeight_DOA);
    }

    /* Calculate the weighted average values for the azimuth and elevation angles */
    wtMeanAzimuth_DOA = wtMeanAzimuth_DOA / wtSum_DOA;
    wtMeanElevation_DOA = wtMeanElevation_DOA / wtSum_DOA;
    wtAzimuthSquared_DOA = wtAzimuthSquared_DOA / wtSum_DOA;
    wtElevationSquared_DOA = wtElevationSquared_DOA / wtSum_DOA;

    /* Copy the weighted average values to the global variable holding all feature vectors
    * Since no swapping has occurred at this point, swap the azimuth and elevation values to account for
    * the transpose required after taking the elevation FFT
    *
    */
    // gfeatures.pWtaz_mean = wtMeanElevation_DOA;
    // gfeatures.pWtel_mean = wtMeanAzimuth_DOA;
    // gfeatures.pWtaz_std = wtElevationSquared_DOA - (wtMeanElevation_DOA * wtMeanElevation_DOA);
    // gfeatures.pWtel_std = wtAzimuthSquared_DOA - (wtMeanAzimuth_DOA * wtMeanAzimuth_DOA);

    /* Test - modified HWA paramset so angle matrix matches MATLAB model; no swapping done */
    gfeatures.pWtaz_mean = wtMeanAzimuth_DOA;
    gfeatures.pWtel_mean = wtMeanElevation_DOA;
    gfeatures.pWtaz_std = wtAzimuthSquared_DOA - (wtMeanAzimuth_DOA * wtMeanAzimuth_DOA);
    gfeatures.pWtel_std = wtElevationSquared_DOA - (wtMeanElevation_DOA * wtMeanElevation_DOA);

    for (i = 0; i < LEN_CORR - 1; i++)
    {
    gfeatures.az_corr_buf[i] = gfeatures.az_corr_buf[i + 1];
    gfeatures.dopp_corr_buf[i] = gfeatures.dopp_corr_buf[i + 1];
    }

    gfeatures.az_corr_buf[LEN_CORR - 1] = gfeatures.pWtaz_mean;
    gfeatures.dopp_corr_buf[LEN_CORR - 1] = gfeatures.pWtdoppler;

    if (gfeatures.frameCount > LEN_CORR - 1)
    {
    Computefeatures_Hybrid();
    }
    else
    {
    gfeatures.pAzdoppcorr = 0;
    }

    exit:
    if (obj != NULL)
    {
    obj->inProgress = false;
    }

    return retVal;
    }

    let me know changes require to make example work for all gesture conditions on AWR6843ISK?

    regards,

    mani

  • hi josh,

     Any update and my previous query and changes require to make example work for all gesture conditions on AWR6843ISK?

    regards,

    mani

  • Hi Mani, 

    Sorry for the delay here. Providing all of the necessary code modifications for a large change in the demo like this is outside the scope of this forum. Have you been able to step through the code in debug mode using CCS to find out what the issue may be? 

    Regards,

    Josh