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: HWA_TRIG_MODE_DMA trigger paramset

Genius 13655 points
Part Number: AM2732

Hello Champs,

Customer is using HWA on AM2732 EVM board. He sets the HWA_TRIG_MODE_DMA to trigger HWA Paramset, loopCnt is 4; The paramset can be triggered by DMA when debugging with CCS and the first loop is processed normally. Then EDMA moves the data from hwa membank to L3. This EDMA triggers the chain's EDMA channel to move the data needed for the second loop to the HWA's membank. The data of the second loop has been successfully moved to the membank of HWA via the CCS memory, but the HWA's paramset has not been triggered, at this point the value of the register loop_cnt is 2. However, the data in hwa's dest membank is still the result of the processing of the first loop, that is, the second loop does not start processing; why is this problem? Loop_cnt=2 Does it mean that hotSignature has set the corresponding bit in register DMA2HWA_TRIG in place? 

Below is the related code.

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <kernel/dpl/DebugP.h>
#include <kernel/dpl/CycleCounterP.h>
#include <drivers/hwa.h>
#include "ti_drivers_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include "dpedma/dpedma.h"
#include "dpedma/dpedmahwa.h"

/*global paramset*/
HWA_Handle  gHwaHandle;
DPEDMA_ChanCfg gEdmaChannelCfg[10];
Edma_IntrObject gEdmaIntrObj[10];
uint32_t gAddressArray[10]={0};
uint32_t PrevParamsetEndIdx = 0;
HWA_CommonConfig    COMPRESScommonConfig;

uint16_t CompressedData[1400832];
#pragma DATA_ALIGN(CompressedData, 256);
#pragma DATA_SECTION(CompressedData, ".l3ram");

int16_t DataDeCompressed[49152];
#pragma DATA_ALIGN(DataDeCompressed, 256);
#pragma DATA_SECTION(DataDeCompressed, ".l3ram");


/*function */

static void allocateEDMAShadowChannel(EDMA_Handle edmaHandle, uint32_t *param);
void DPC_ObjDet_EDMAChannelConfigAssist(EDMA_Handle handle, uint32_t chNum, uint32_t shadowParam, uint32_t eventQueue, DPEDMA_ChanCfg *chanCfg);
void EDMA_ChannelConfig();
static  int32_t DPU_DopplerProcHWA_configEdmaDecompressionIn();
static  int32_t DPU_DopplerProcHWA_configEdmaDecompressionOut();





static void allocateEDMAShadowChannel(EDMA_Handle edmaHandle, uint32_t *param)
{
    int32_t             testStatus = SystemP_SUCCESS;
    EDMA_Config        *config;
    EDMA_Object        *object;

    config = (EDMA_Config *) edmaHandle;
    object = config->object;

    if((object->allocResource.paramSet[*param/32] & (1U << *param%32)) != (1U << *param%32))
    {
        testStatus = EDMA_allocParam(edmaHandle, param);
        DebugP_assert(testStatus == SystemP_SUCCESS);
    }

    return;
}


void DPC_ObjDet_EDMAChannelConfigAssist(EDMA_Handle handle, uint32_t chNum, uint32_t shadowParam, uint32_t eventQueue, DPEDMA_ChanCfg *chanCfg)
{
    DebugP_assert(chanCfg != NULL);

    DPEDMA_allocateEDMAChannel(handle, &chNum, &chNum, &chNum);

    chanCfg->channel = chNum;
    chanCfg->tcc = chNum;
    chanCfg->paramId = chNum;

    chanCfg->shadowPramId = shadowParam;

    allocateEDMAShadowChannel(handle, &shadowParam);

    chanCfg->eventQueue = eventQueue;

    return;
}


void EDMA_ChannelConfig()
{
    DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                           23,
                                           64+4,
                                           0,
                                           &gEdmaChannelCfg[0]);          //Decompressed dataIn EDMA ping
    DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 0 \r\n");
    DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                       19,
                                       64+8,
                                       0,
                                       &gEdmaChannelCfg[1]); //Decompressed dataIn hot signature ping
    DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 1 \r\n");
    DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                        42,
                                        64+6,
                                        0,
                                        &gEdmaChannelCfg[2]); //Decompressed dataout ping
    DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 2 \r\n");
    DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                            3,
                                            64+5,
                                            0,
                                            &gEdmaChannelCfg[3]);          //Decompressed dataIn EDMA pong
    DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 3 \r\n");
     DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                        20,
                                        64+9,
                                        0,
                                        &gEdmaChannelCfg[4]); //Decompressed dataIn hot signature pong
     DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 4 \r\n");
     DPC_ObjDet_EDMAChannelConfigAssist(gEdmaHandle[0],
                                         62,
                                         64+7,
                                         0,
                                         &gEdmaChannelCfg[5]); //Decompressed dataout pong
     DebugP_log("DPC_ObjDet_EDMAChannelConfigAssist 5 \r\n");
}

static int32_t DPU_DopplerProcHWA_configEdmaDecompressionIn()
{
    DPEDMA_syncABCfg            syncABCfg;
    DPEDMA_ChainingCfg          chainingCfg;
    int32_t                     retVal = 0;

    /* PING */
    chainingCfg.chainingChannel                  = gEdmaChannelCfg[1].channel;
    chainingCfg.isIntermediateChainingEnabled = true;
    chainingCfg.isFinalChainingEnabled        = true;

    syncABCfg.srcAddress  = (uint32_t)(gAddressArray[0]);
    syncABCfg.destAddress = (uint32_t)(CSL_DSS_HWA_DMA0_RAM_BANK4_BASE);   //bank4
    syncABCfg.aCount      = 4096;
    syncABCfg.bCount      = 1;
    syncABCfg.cCount      = 6;
    syncABCfg.srcBIdx     = 0;
    syncABCfg.dstBIdx     = 0;
    syncABCfg.srcCIdx     = 8192;
    syncABCfg.dstCIdx     = 0;

    retVal = DPEDMA_configSyncAB(gEdmaHandle[0],
                                    &gEdmaChannelCfg[0],
                                    &chainingCfg,
                                    &syncABCfg,
                                    false,//isEventTriggered
                                    false, //isIntermediateTransferCompletionEnabled
                                    false,//isTransferCompletionEnabled
                                    NULL, //transferCompletionCallbackFxn
                                    NULL, //transferCompletionCallbackFxnArg
                                    NULL); /* intrObj */

    if(retVal!=0)
    {
        DebugP_log("Ping DPEDMA_configSyncAB error , retval=%d\r\n",retVal);
        goto exit;
    }
    if(&gEdmaChannelCfg[1]==NULL)
    {
        DebugP_log("gEdmaChannelCfg[1]==NULL");
    }
    if(gHwaHandle==NULL)
    {
        DebugP_log("gHwaHandle==NULL");
    }
    /* One Hot Signature to trigger the HWA */
    retVal = DPEDMAHWA_configOneHotSignature(gEdmaHandle[0],
                                                  &gEdmaChannelCfg[1],
                                                  gHwaHandle,
                                                  0,     // hwa trigger src = paramset0
                                                  0);
    if(retVal!=0)
     {
         DebugP_log("Ping DPEDMAHWA_configOneHotSignature error , retval=%d\r\n",retVal);
         goto exit;
     }

    /*Pong*/
    chainingCfg.chainingChannel                  = gEdmaChannelCfg[4].channel;
    syncABCfg.srcAddress  = (uint32_t)(gAddressArray[0])+4096;
    syncABCfg.destAddress = (uint32_t)(CSL_DSS_HWA_DMA0_RAM_BANK5_BASE);   //bank5
    retVal = DPEDMA_configSyncAB(gEdmaHandle[0],
                                        &gEdmaChannelCfg[3],
                                        &chainingCfg,
                                        &syncABCfg,
                                        false,//isEventTriggered
                                        false, //isIntermediateTransferCompletionEnabled
                                        false,//isTransferCompletionEnabled
                                        NULL, //transferCompletionCallbackFxn
                                        NULL, //transferCompletionCallbackFxnArg
                                        NULL); /* intrObj */
    if(retVal!=0)
    {
        DebugP_log("Ping DPEDMA_configSyncAB error , retval=%d\r\n",retVal);
        goto exit;
    }
    retVal = DPEDMAHWA_configOneHotSignature(gEdmaHandle[0],
                                                     &gEdmaChannelCfg[4],
                                                     gHwaHandle,
                                                     2,     // hwa trigger src = paramset0
                                                     0);
    if(retVal!=0)
      {
            DebugP_log("Pong DPEDMAHWA_configOneHotSignature error , retval=%d\r\n",retVal);
            goto exit;
      }


exit:
    return(retVal);

}

uint32_t count = 0;
static void DPU_DopplerProcHWA_edmaDoneIsrCallback(Edma_IntrHandle intrHandle,
   void *args)
{
    count++;
}
static  int32_t DPU_DopplerProcHWA_configEdmaDecompressionOut()
{

    DPEDMA_syncABCfg            syncABCfg;
    DPEDMA_ChainingCfg          chainingCfg;
    int32_t                     retVal;

    /* PING */
    chainingCfg.chainingChannel                  = gEdmaChannelCfg[0].channel;
    chainingCfg.isIntermediateChainingEnabled = true;//true;
    chainingCfg.isFinalChainingEnabled        = false;

    syncABCfg.srcAddress  = (uint32_t)(CSL_DSS_HWA_DMA0_RAM_BANK0_BASE);
    syncABCfg.destAddress = (uint32_t)(gAddressArray[1]);
    syncABCfg.aCount      = 8192;
    syncABCfg.bCount      = 1;
    syncABCfg.cCount      = 6;
    syncABCfg.srcBIdx     = 0;
    syncABCfg.dstBIdx     = 0;
    syncABCfg.srcCIdx     = 0;
    syncABCfg.dstCIdx     = 16384;

    retVal = DPEDMA_configSyncAB(   gEdmaHandle[0],
                                    &gEdmaChannelCfg[2],
                                    &chainingCfg,
                                    &syncABCfg,
                                    true,//isEventTriggered
                                    false, //isIntermediateTransferCompletionEnabled
                                    false,//isTransferCompletionEnabled
                                    NULL, //transferCompletionCallbackFxn
                                    NULL,//(void *)NULL, //transferCompletionCallbackFxnArg
                                    NULL); /* intrObj  for edma decompress data out */
    DebugP_log("DPU_DopplerProcHWA_configEdmaDecompressionOut Ping retVal=%d\r\n",retVal);

    /*PONG*/
    chainingCfg.chainingChannel                  = gEdmaChannelCfg[3].channel;
    syncABCfg.srcAddress  = (uint32_t)(CSL_DSS_HWA_DMA0_RAM_BANK2_BASE);
    syncABCfg.destAddress = (uint32_t)(gAddressArray[1])+8192;
    retVal = DPEDMA_configSyncAB(      gEdmaHandle[0],
                                       &gEdmaChannelCfg[5],
                                       &chainingCfg,
                                       &syncABCfg,
                                       true,//isEventTriggered
                                       true, //isIntermediateTransferCompletionEnabled
                                       true,//isTransferCompletionEnabled
                                       DPU_DopplerProcHWA_edmaDoneIsrCallback, //transferCompletionCallbackFxn
                                       (void*)(&count),//(void *)NULL, //transferCompletionCallbackFxnArg
                                       &gEdmaIntrObj[0]); /* intrObj  for edma decompress data out */

    DebugP_log("DPU_DopplerProcHWA_configEdmaDecompressionOut Pong retVal=%d\r\n",retVal);

    return(retVal);

}

int32_t HWACompression_config_EGE()
{

       int32_t     errCode = SystemP_SUCCESS;
       uint8_t     paramsetIdx = 0;
       HWA_ParamConfig     hwaParamCfg[2];
//       uint32_t index;
       HWA_InterruptConfig     paramISRConfig;
       uint8_t destChan;

//       memset((void*)&paramISRConfig,0,sizeof(HWA_InterruptConfig));
       memset(hwaParamCfg, 0, 2*sizeof(HWA_ParamConfig));
//       for(index = 0; index < 2; index++)
//       {
//              errCode = HWA_disableParamSetInterrupt(gHwaHandle, index+PrevParamsetEndIdx ,
//                      HWA_PARAMDONE_INTERRUPT_TYPE_CPU_INTR1 | HWA_PARAMDONE_INTERRUPT_TYPE_DMA);
//              if (errCode != 0)
//              {
//                  DebugP_log("disable paramset Interrupt error index = %d\r\n",index);
//                  goto exit;
//              }
//       }


       /*Compress Paramset*/
//       uint16_t numRx = 8;
//       uint16_t numRangeBins = 512;
//       uint16_t numRangeBinsPerBlock = 8;
//       uint16_t Compressin_SamplesPerBlock = numRangeBinsPerBlock*numRx;  //rangeBins Per block * numRxAntenna Per block;
//       uint16_t CompressIn_bytesPerSample = 4;        //int16_t complex
//       uint16_t Compress_numBlocks =numRx*numRangeBins/Compressin_SamplesPerBlock ; //57
//       uint16_t Compress_inputBytesPerBlock = CompressIn_bytesPerSample*Compressin_SamplesPerBlock; //256
//       uint16_t Compressout_BytesPerBlock = compRatio*Compress_inputBytesPerBlock;
//       uint16_t Compressout_bytesPerSample = 4;
//       uint16_t Compressout_SamplesPerBlock =Compressout_BytesPerBlock/Compressout_bytesPerSample;
       /*Decompress Paramset*/
//       uint16_t DeCompress_bytesPerSample = 4;        //int16_t complex
//       uint16_t DeCompressout_SamplesPerBlock =numRx*numRangeBinsPerBlock;
//       uint16_t DeCompressout_BytesPerBlock = DeCompressout_SamplesPerBlock*DeCompress_bytesPerSample;
//       uint16_t DeCompress_numBlock = Compress_numBlocks;
//       uint16_t DeCompress_inputBytesPerBlock = compRatio*DeCompressout_BytesPerBlock; //128
//       uint16_t DeCompressin_SamplesPerBlock = DeCompress_inputBytesPerBlock/DeCompress_bytesPerSample;  //rangeBins Per block * numRxAntenna Per block;

      /*HWA Paramset config*/
      /*Compress EGE Paramset*/


//       hwaParamCfg[paramsetIdx].triggerMode = HWA_TRIG_MODE_SOFTWARE;
//       hwaParamCfg[paramsetIdx].accelMode = HWA_ACCELMODE_COMPRESS;
//       hwaParamCfg[paramsetIdx].contextswitchCfg = HWA_PARAMSET_CONTEXTSWITCH_DISABLE;
//
//       /* ACCELMODE CONFIG */
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.ditherEnable = HWA_FEATURE_BIT_DISABLE;//HWA_FEATURE_BIT_ENABLE;  // Enable dither to suppress quantization spurs
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.compressDecompress = HWA_CMP_DCMP_COMPRESS;
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.method = HWA_COMPRESS_METHOD_EGE;
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.passSelect = HWA_COMPRESS_PATHSELECT_BOTHPASSES;
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.headerEnable = HWA_FEATURE_BIT_ENABLE;
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.scaleFactorBW = 4; //log2(sample bits)
//
//       /* SRC CONFIG */
//       hwaParamCfg[paramsetIdx].source.srcAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(COMP_DATA_IN_HWA_SRC_ADDR);
//
//       hwaParamCfg[paramsetIdx].source.srcRealComplex = HWA_SAMPLES_FORMAT_COMPLEX;
//       hwaParamCfg[paramsetIdx].source.srcWidth = HWA_SAMPLES_WIDTH_16BIT;
//       hwaParamCfg[paramsetIdx].source.srcSign = HWA_SAMPLES_SIGNED;
//       hwaParamCfg[paramsetIdx].source.srcConjugate = HWA_FEATURE_BIT_DISABLE;
//       hwaParamCfg[paramsetIdx].source.srcScale = 8;
//
//       DebugP_log("%d\t%d\t%d\t%d\t%d\t%d\r\n",hwaParamCfg[paramsetIdx].source.srcAddr,hwaParamCfg[paramsetIdx].source.srcRealComplex,hwaParamCfg[paramsetIdx].source.srcWidth,hwaParamCfg[paramsetIdx].source.srcSign,
//                  hwaParamCfg[paramsetIdx].source.srcConjugate,hwaParamCfg[paramsetIdx].source.srcScale);
//
//       /* DEST CONFIG */
//       hwaParamCfg[paramsetIdx].dest.dstAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(COMP_DATA_OUT_HWA_DST_ADDR);
//       hwaParamCfg[paramsetIdx].dest.dstRealComplex = HWA_SAMPLES_FORMAT_COMPLEX;
//       hwaParamCfg[paramsetIdx].dest.dstWidth = HWA_SAMPLES_WIDTH_16BIT; /* 16 bit real, 16 bit imag */
//       hwaParamCfg[paramsetIdx].dest.dstSign = HWA_SAMPLES_UNSIGNED;
//       hwaParamCfg[paramsetIdx].dest.dstConjugate = HWA_FEATURE_BIT_DISABLE;
//       hwaParamCfg[paramsetIdx].dest.dstScale = 0;
//       hwaParamCfg[paramsetIdx].dest.dstSkipInit = 0;
//
//
//       /*********************************/
//       /* PING EGE COMPRESSION PARAMSET */
//       /*********************************/
//       hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.EGEKarrayLength = 3; //log2(8)
//
//       /* SRC CONFIG */
//       hwaParamCfg[paramsetIdx].source.srcAcnt = Compressin_SamplesPerBlock - 1;
//       hwaParamCfg[paramsetIdx].source.srcAIdx = CompressIn_bytesPerSample;
//       hwaParamCfg[paramsetIdx].source.srcBcnt = 1-1;//Compress_numBlocks-1;
//       hwaParamCfg[paramsetIdx].source.srcBIdx = Compress_inputBytesPerBlock;
//
//       DebugP_log("%d\t%d\t%d\t%d\t\r\n",hwaParamCfg[paramsetIdx].source.srcAcnt,hwaParamCfg[paramsetIdx].source.srcAIdx,hwaParamCfg[paramsetIdx].source.srcBcnt,hwaParamCfg[paramsetIdx].source.srcBIdx);
//
//       /* DEST CONFIG */
//       hwaParamCfg[paramsetIdx].dest.dstAcnt = Compressout_SamplesPerBlock - 1;
//       hwaParamCfg[paramsetIdx].dest.dstAIdx = Compressout_bytesPerSample;
//       hwaParamCfg[paramsetIdx].dest.dstBIdx = Compressout_BytesPerBlock;
//
//       errCode = HWA_configParamSet(gHwaHandle,paramsetIdx,&hwaParamCfg[paramsetIdx],NULL);
//       if (errCode != 0)
//       {
//           DebugP_log("Error:COMPRESS HWA_configParamSet ERROR,errCode=%d\r\n", errCode);
//           goto exit;
//       }

         /*Decompress dummy paramset Ping*/
//         hwaParamCfg[paramsetIdx].triggerMode = HWA_TRIG_MODE_DMA;
//         hwaParamCfg[paramsetIdx].triggerSrc = 0;
//         hwaParamCfg[paramsetIdx].accelMode = HWA_ACCELMODE_NONE;
//         DebugP_log("dummy PrevParamsetEndIdx=%d\r\n",PrevParamsetEndIdx);
//         errCode = HWA_configParamSet(gHwaHandle,
//                                       PrevParamsetEndIdx,
//                                       &hwaParamCfg[paramsetIdx],NULL);
//         if (errCode != 0)
//         {
//             DebugP_log("Error:DECOMPRESS DUMMP HWA_configParamSet ERROR,errCode=%d\r\n", errCode);
//             goto exit;
//         }
   /*DeCompress EGE Paramset Ping*/
//      paramsetIdx++;
//      PrevParamsetEndIdx++;

      hwaParamCfg[paramsetIdx].triggerMode = HWA_TRIG_MODE_DMA;//HWA_TRIG_MODE_IMMEDIATE;
      hwaParamCfg[paramsetIdx].triggerSrc = 0;
      hwaParamCfg[paramsetIdx].accelMode = HWA_ACCELMODE_COMPRESS;

      /* ACCELMODE CONFIG */
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.ditherEnable = HWA_FEATURE_BIT_DISABLE;//HWA_FEATURE_BIT_ENABLE;  // Enable dither to suppress quantization spurs
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.compressDecompress = HWA_CMP_DCMP_DECOMPRESS;
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.method = HWA_COMPRESS_METHOD_EGE;
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.passSelect = HWA_COMPRESS_PATHSELECT_BOTHPASSES;
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.headerEnable = HWA_FEATURE_BIT_ENABLE;
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.scaleFactorBW = 4; //log2(sample bits)
      hwaParamCfg[paramsetIdx].accelModeArgs.compressMode.EGEKarrayLength = 3; //log2(8)

      /* SRC CONFIG */
      hwaParamCfg[paramsetIdx].source.srcAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(CSL_DSS_HWA_DMA0_RAM_BANK4_BASE);

      hwaParamCfg[paramsetIdx].source.srcRealComplex = HWA_SAMPLES_FORMAT_COMPLEX;
      hwaParamCfg[paramsetIdx].source.srcWidth = HWA_SAMPLES_WIDTH_16BIT;
      hwaParamCfg[paramsetIdx].source.srcSign = HWA_SAMPLES_UNSIGNED;
      hwaParamCfg[paramsetIdx].source.srcConjugate = HWA_FEATURE_BIT_DISABLE;
      hwaParamCfg[paramsetIdx].source.srcScale = 0;

      hwaParamCfg[paramsetIdx].source.srcAcnt = 32-1;//DeCompressin_SamplesPerBlock - 1;
      hwaParamCfg[paramsetIdx].source.srcAIdx = 4;//DeCompress_bytesPerSample;
      hwaParamCfg[paramsetIdx].source.srcBcnt = 32 - 1;  //128-1   //3 loops to decompress 48KB one block data
      hwaParamCfg[paramsetIdx].source.srcBIdx = 128;//DeCompressin_SamplesPerBlock*DeCompress_bytesPerSample; //128

      DebugP_log("%d\t%d\t%d\t%d\r\n",hwaParamCfg[paramsetIdx].source.srcAcnt,hwaParamCfg[paramsetIdx].source.srcAIdx, hwaParamCfg[paramsetIdx].source.srcBcnt,hwaParamCfg[paramsetIdx].source.srcBIdx);

      /* DEST CONFIG */
      hwaParamCfg[paramsetIdx].dest.dstAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(CSL_DSS_HWA_DMA0_RAM_BANK0_BASE);
      hwaParamCfg[paramsetIdx].dest.dstRealComplex = HWA_SAMPLES_FORMAT_COMPLEX;
      hwaParamCfg[paramsetIdx].dest.dstWidth = HWA_SAMPLES_WIDTH_16BIT; /* 16 bit real, 16 bit imag */
      hwaParamCfg[paramsetIdx].dest.dstSign = HWA_SAMPLES_SIGNED;
      hwaParamCfg[paramsetIdx].dest.dstConjugate = HWA_FEATURE_BIT_DISABLE;
      hwaParamCfg[paramsetIdx].dest.dstScale = 0;
      hwaParamCfg[paramsetIdx].dest.dstSkipInit = 0;

      hwaParamCfg[paramsetIdx].dest.dstAcnt = 64-1;//DeCompressout_SamplesPerBlock - 1;
      hwaParamCfg[paramsetIdx].dest.dstAIdx = 4;//DeCompress_bytesPerSample;
      hwaParamCfg[paramsetIdx].dest.dstBIdx = 256;//DeCompressout_BytesPerBlock;

      errCode = HWA_configParamSet(gHwaHandle,PrevParamsetEndIdx,&hwaParamCfg[paramsetIdx],NULL);
      if (errCode != 0)
         {
             DebugP_log("Error:DECOMPRESS HWA_configParamSet ERROR,errCode=%d\r\n", errCode);
             goto exit;
         }
      HWA_getDMAChanIndex(gHwaHandle,gEdmaChannelCfg[2].channel,&destChan);
      DebugP_log("destChan = %d\tPrevParamsetEndIdx=%d\r\n",destChan,PrevParamsetEndIdx);
      paramISRConfig.interruptTypeFlag = HWA_PARAMDONE_INTERRUPT_TYPE_DMA;
      paramISRConfig.dma.dstChannel = destChan;

      errCode = HWA_enableParamSetInterrupt(gHwaHandle,PrevParamsetEndIdx,&paramISRConfig);
      if (errCode != 0)
      {
          DebugP_log("HWA_enableParamSetInterrupt failed\r\n");
          goto exit;
      }
      /*Pong*/

      PrevParamsetEndIdx++;
      paramsetIdx++;

      hwaParamCfg[paramsetIdx] = hwaParamCfg[0];
      hwaParamCfg[paramsetIdx].triggerSrc = 2;
      hwaParamCfg[paramsetIdx].accelMode = HWA_ACCELMODE_COMPRESS;
      hwaParamCfg[paramsetIdx].source.srcAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(CSL_DSS_HWA_DMA0_RAM_BANK5_BASE);
      hwaParamCfg[paramsetIdx].dest.dstAddr = (uint32_t)HWADRV_ADDR_TRANSLATE_CPU_TO_HWA(CSL_DSS_HWA_DMA0_RAM_BANK2_BASE);

      errCode = HWA_configParamSet(gHwaHandle,PrevParamsetEndIdx,&hwaParamCfg[paramsetIdx],NULL);
      if (errCode != 0)
         {
                  DebugP_log("Error:DECOMPRESS HWA_configParamSet ERROR,errCode=%d\r\n", errCode);
                  goto exit;
         }
       HWA_getDMAChanIndex(gHwaHandle,gEdmaChannelCfg[5].channel,&destChan);
       DebugP_log("destChan = %d\tPrevParamsetEndIdx=%d\r\n",destChan,PrevParamsetEndIdx);
       paramISRConfig.interruptTypeFlag = HWA_PARAMDONE_INTERRUPT_TYPE_DMA;
       paramISRConfig.dma.dstChannel = destChan;

       errCode = HWA_enableParamSetInterrupt(gHwaHandle,PrevParamsetEndIdx,&paramISRConfig);
       if (errCode != 0)
       {
           DebugP_log("HWA_enableParamSetInterrupt failed\r\n");
           goto exit;
       }


      /*****************/
      /* COMMON CONFIG */
      /*****************/

         memset((void *)&COMPRESScommonConfig, 0, sizeof(HWA_CommonConfig));
         COMPRESScommonConfig.configMask = HWA_COMMONCONFIG_MASK_STATEMACHINE_CFG;
         COMPRESScommonConfig.configMask|=HWA_COMMONCONFIG_MASK_EGECOMRESS_KPARAM;
         COMPRESScommonConfig.paramStartIdx = 0 ;
         COMPRESScommonConfig.paramStopIdx = 1;
         COMPRESScommonConfig.numLoops = 6;
         COMPRESScommonConfig.compressConfig.EGEKparam[0] = 3;
         COMPRESScommonConfig.compressConfig.EGEKparam[1] = 4;
         COMPRESScommonConfig.compressConfig.EGEKparam[2] = 5;
         COMPRESScommonConfig.compressConfig.EGEKparam[3] = 7;
         COMPRESScommonConfig.compressConfig.EGEKparam[4] = 9;
         COMPRESScommonConfig.compressConfig.EGEKparam[5] = 11;
         COMPRESScommonConfig.compressConfig.EGEKparam[6] = 13;
         COMPRESScommonConfig.compressConfig.EGEKparam[7] = 15;

         errCode = HWA_configCommon(gHwaHandle, &COMPRESScommonConfig);
         if (errCode != 0)
         {
             DebugP_log("Error:COMMON CONFIG HWA_configCommon ERROR,errCode=%d\r\n", errCode);
             goto exit;
         }

   exit:

   return errCode;

}


void hwaHandlefxn(void *args)
{
    DebugP_log("Start to handle HWA Process\r\n");
    gAddressArray[0] = (uint32_t)(&CompressedData[0]);   // compressed data address
    gAddressArray[1] = (uint32_t)(&DataDeCompressed[0]); //decompressed data address
    DebugP_log("gAddressArray[%d]=%p\r\n",0,gAddressArray[0]);
    DebugP_log("gAddressArray[%d]=%p\r\n",1,gAddressArray[1]);

    int32_t  status = SystemP_SUCCESS;
    CycleCounterP_reset(); /* Reset CPU cycle counter */
    gHwaHandle = HWA_open(0, NULL, &status);
    if(gHwaHandle == NULL)
     {
       DebugP_log("Error: Unable to open HWA instance. Error: %d\r\n", status);
       DebugP_assert(gHwaHandle == NULL);
     }
    DebugP_log("HWA Instance has been opened successfully\r\n");

    /*EDMA CONFIG*/
    EDMA_ChannelConfig();


    HWACompression_config_EGE();
    status=DPU_DopplerProcHWA_configEdmaDecompressionIn();
    if(status!=0){DebugP_log("DPU_DopplerProcHWA_configEdmaDecompressionIn failed\r\n");}
    status=DPU_DopplerProcHWA_configEdmaDecompressionOut();
    if(status!=0){DebugP_log("DPU_DopplerProcHWA_configEdmaDecompressionOut failed\r\n");}
    DebugP_log("EDMA Config Done\r\n");


    /*decompressed one block data*/

    HWA_enable(gHwaHandle, 0);
    HWA_configCommon(gHwaHandle, &COMPRESScommonConfig);
    status=HWA_enable(gHwaHandle, 1);
    DebugP_log("numParamset = %d status=%d\r\n",((HWA_Object *)gHwaHandle)->hwAttrs->numHwaParamSets,status);
    status = DPEDMA_edmaStartTransferManualTrigger(gEdmaHandle[0], (uint32_t)gEdmaChannelCfg[0].channel);
    if (status != 0)
      {
          DebugP_log("DPEDMA_edmaStartTransferManualTrigger error status=%d\r\n",status);
      }
      else
      {
          DebugP_log("DPEDMA_edmaStartTransferManualTrigger without error\r\n");
      }
    status = DPEDMA_edmaStartTransferManualTrigger(gEdmaHandle[0], (uint32_t)gEdmaChannelCfg[3].channel);
    if (status != 0)
    {
        DebugP_log("DPEDMA_edmaStartTransferManualTrigger error status=%d\r\n",status);
    }
    else
    {
        DebugP_log("DPEDMA_edmaStartTransferManualTrigger without error\r\n");
    }





    /* Open HWA driver */
//    runCmpTest((uint8_t*)(&DataCompressed[0]),0.5);
    /* HWA driver close */

//    HWA_controlPeripheralSuspendMode(gHwaHandle, 0);
//    status += HWA_close(gHwaHandle);
//    DebugP_assert(SystemP_SUCCESS == status);
//
//    if(status == SystemP_SUCCESS)
//    {
//        DebugP_log("\r\n\nHWA BFP Compression/Decompression Test Completed!!\r\n");
//    }

}



Thanks
Regards
Shine

  • Updated from customer:

    After testing, customer found that it may be caused by the Ccnt in DPEDMAHWA_configOneHotSignature. He configured the hotSignature value to HWA loopCnt. All loops can be executed successfully. and output to L3 normally; in the SDK, this function configures the hotSignature's Ccnt=1; why doesn't the Ccnt reload after it's 0? 

    Thanks
    Regards
    Shine

  • Hello Shine,

    I am reaching out to the experts to look into this. Please give me a couple of days to respond back.

    Thank you,

    Anita 

  • Hello Anita,

    OK. Thank you very much.

    Updated from the customer.

    I found the reason, in DPEDMA_setup_shadow_link, there is a variable edmaParam, which is initialized after using EDMA_ccPaRAMEntry_init by using  "=" for structure configure like EdmaParam = *config; After initialized, resulting in an offset of 2Byte, which missets the parameters, resulting in a paramset error in the final configuration;

    If I do not use “=” for structure configure, the parameters are configured normally, the program can also run normally;

    Please ask the expert to confirm if the problem was introduced by the structure configure.

    Thanks
    Regards
    Shine