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.

AWR2944EVM: Acces and compression of radar cube data

Part Number: AWR2944EVM
Other Parts Discussed in Thread: AWR2944

Tool/software:

I am modifying AWR2944EVM's DDM demo, so that besides its current functionality it computes STFT spectrograms and sends them to the end user via TLV messages. I managed to successfully implement the data path via the shared HSRAM however I have some issues concerning handling the actual radar cube data.

I need to access just the raw radar cube data at a single range bin per CPI and I have several questions about interacting with the radar cube:

1.) I assume that the radar data cube compressed by default within the demo. Are these the line specifying the compression factor and compression type?

if(staticCfg->compressionCfg.compressionMethod==HWA_COMPRESS_METHOD_BFP){
inputBytesPerBlock = 4 * staticCfg->compressionCfg.rangeBinsPerBlock;
}
else{
inputBytesPerBlock = 4 * staticCfg->compressionCfg.numRxAntennaPerBlock * staticCfg->compressionCfg.rangeBinsPerBlock;
}

2.) My function fixedSTFT_execute is called within DPC_ObjectDetection_execute directly after DPU_RangeProcHWA_process, like so:

retVal = DPU_RangeProcHWA_process(subFrmObj->dpuRangeObj, &subFrmObj->dpuCfg.rangeCfg, &outRangeProc);
...
checkFFTClipStatus(objDetObj, &result->FFTClipCount[0]);
radarCubePtr = subFrmObj->dpuCfg.dopplerCfg.hwRes.radarCube.data;
fixedSTFT_execute(objDetObj->stftHandle, radarCubePtr, objDetObj->stftOutputBuf, objDetObj);

This is the original code with which I tried to access the radar cube but it seems to be compressed at this stage. How can I access the non-compressed radar cube? If this is not possible what advice would you give to get uncompressed radarcube data at a given range bin? Can I decompress just part of the data only on the CPU without tapping into the HWA code? 

3.) Is it possible to turn the compression engine off?

4.) By default is the full "doppler radar cube" accessible in a non-compressed format available in the L3 after it gets decompressed by doppler processing? 

Best regards,

Mark

  • Hi Mark,

    Are these the line specifying the compression factor and compression type?

    Compression ratio and compression method are configured via compressionCfg CLI command.

    How can I access the non-compressed radar cube? If this is not possible what advice would you give to get uncompressed radarcube data at a given range bin? Can I decompress just part of the data only on the CPU without tapping into the HWA code? 

    Decompression is performed in the Doppler processing DPU. You will have decompressed 1D FFT available for a given range bin during doppler processing.

    Based on the number of range bins per block configuration in the compressionCfg CLI command, those number of range bins will be decompressed and stored on DSS_L3 in the decompression scratch buffer.

    Is it possible to turn the compression engine off?

    You can configure the compression ratio to be 1. But this will increase the size of radar cube. So, you need to ensure that you have sufficient memory available on DSS_L3.

    By default is the full "doppler radar cube" accessible in a non-compressed format available in the L3 after it gets decompressed by doppler processing? 

    No, if 8 range bins are compressed together, then those 8 range bins data is decompressed together.

    Regards,

    Samhitha

  • Hi, thank you for your reply!

    Decompression is performed in the Doppler processing DPU. You will have decompressed 1D FFT available for a given range bin during doppler processing.

    So do you suggest that the best way to access the decompressed radar cube is within the "dopplerprochwaDDMA.c" file? Is there any feasible way of accessing the uncompressed data form within the scope of the objectdetection.c file?

    I understand that after it finishes executing the radarcube returns to the compressed form, is this correct?

    You can configure the compression ratio to be 1. But this will increase the size of radar cube. So, you need to ensure that you have sufficient memory available on DSS_L3.

    Assuming that it will fit into the L3, won't the data still be in the compressed format (, i.e. EGC or BFP)? If they are then to my understanding, I still won't be able to read them as raw cmplx16ReIm_t data, is this correct? This is because they will be stored as shown in the image, the difference being that the compression will be of a factor 1, which will make it lossless, but still not directly interpretable as the raw cmplx16ReIm_t.

    Best regards,

    Mark

  • Hi Mark,

    So do you suggest that the best way to access the decompressed radar cube is within the "dopplerprochwaDDMA.c" file? Is there any feasible way of accessing the uncompressed data form within the scope of the objectdetection.c file?

    Yes, you can access decompressed radar cube during doppler processing. It's not possible to access whole decompressed radar cube as the decompression scratch buffer is overwritten.

    In the current processing chain, disabling of compression is not supported. You can make changes in the processing chain to disable compression.

    If they are then to my understanding, I still won't be able to read them as raw cmplx16ReIm_t data, is this correct? This is because they will be stored as shown in the image, the difference being that the compression will be of a factor 1, which will make it lossless, but still not directly interpretable as the raw cmplx16ReIm_t.

    Yes, you are correct. You won't get the decompressed radar cube.

    Regards,

    Samhitha

  • Hello Samhitha, thank you for your reply!

    My idea to tap into the decompressed data is to create an additional L3 buffer in which I will store the samples from a single range bin per CPI. To do that I allocate this buffer once in preStartConfig which works fine. Next I try to pass the pointer to this buffer inside the function DPC_ObjDet_dopplerConfig to the doppler processing struct:

    Inside DPC_ObjDet_dopplerConfig:

    DPU_DopplerProcHWA_HW_Resources *hwRes;
    hwRes->stftInputBuf = objDetObj->stftInputBuf;

    For that I have modified the struct inside dopplerprochwaDDMA.h:

    typedef struct DPU_DopplerProcHWA_HW_Resources_t
    {
    ...
    cmplx16ImRe_t * stftInputBuf;

    }DPU_DopplerProcHWA_HW_Resources;

    The idea is that then I can access the L3 buffer inside the file dopplerprochwaDDMA.c and write there the decompressed cube data, for later usage inside objectdetection.c.

    However the addition of the single entry into the DPU_DopplerProcHWA_HW_Resources struct inside dopplerprochwaDDMA.h crashes the whole demo directly upon initialization with this error:
    [C66xx_DSP] Debug: DPM Module Sync is done
    Error: DPM Report 4 received with error:-30712 arg0:0x64 arg1:0x84eb44
    [Cortex_R5_0] Error: DPM Report 4 received with error:-30712 arg0:0x64 arg1:0x1025a858
    ASSERT: 20.759033s: ../mss/mss_main.c:MmwDemo_DPC_ObjectDetection_reportFxn:2638: 0 failed !!!

    This error can be traced to
    * File mmwave_error.h -> DPU base error -30000
    * File dp_error.h -> DOPPLER DDMA BASE -700
    * File dopplerprochwaDDMA.h -> DPU_DOPPLERPROCHWA_ERROR_NUMCHIRPSPERPING -12 

    However this is clearly not the root cause as commenting out the single described modification of the struct DPU_DopplerProcHWA_HW_Resources results in the code running normal again.

    So with that being said I would be more than happy if you could:
    1.) Explain why the modification of this struct leads to the complete failure of the demos code.
    2.) Please suggest an approach (or confirm my current one) of how to retrieve some decompressed data from dopplerprochwaDDMA.c scope to the objecdetection.c file scope where I have my DPC/DPM custom transport chain setup.

  • Hi Mark,

    Place a breakpoint in CCS at the line where this error occurs. Check if there is any change in the value of any of the variables before and after addition of the additional member in the structure. Since this is a custom change, it's not possible to check this at my end. 

    If you want the 1D FFT of a specific range bin and then you can add a DMA to copy the data from decompression scratch buffer to a given address. You can add this change in the loop where we process each of the range gate in Doppler processing -> DPU_DopplerProcHWA_process.

    Regards,

    Samhitha

  • Hello Samhitha,

    thank you for your support! 

    Could you please provide some guidance on setting a breakpoint inside the file dopplerprochwaDDMA.c please? This file is not within the CCS project and it is not being compiled during build only during the linker's operation the pre-compiled binary is pulled in from this location:  "C:\ti\mmwave_mcuplus_sdk_04_07_00_01\mmwave_mcuplus_sdk_04_07_00_01\ti\datapath\dpu\dopplerprocDDMA\lib\libdopplerproc_hwa_ddma_awr2944.ae66"

    Recompiling the contents of this folder C:\ti\mmwave_mcuplus_sdk_04_07_00_01\mmwave_mcuplus_sdk_04_07_00_01\ti\datapath\dpu\dopplerprocDDMA with "gmake all" did solve the issue. It turns out that the default binary (obviously) didn't pick up the changes made to the .h file which is used during CCS project build. But nevertheless for future development it would be great if you could clarify how to set a breakpoint in the non-project scope file of dopplerprochwaDDMA.c.

    You probably mean this loop? Where after the semaphore check the data from a single block will be present in the  L3 scratch. 

    Best regards

    Mark 

  • Mark,

    But nevertheless for future development it would be great if you could clarify how to set a breakpoint in the non-project scope file of dopplerprochwaDDMA.c.

    I think you are seeing something like the error shown in the below screenshot -

    Use Locate File… button to browse to the location of the source file. The debugger can then find other source files in the same location or use relative path information to find files relative to the current file. Location is remembered for future loads of the same program.

    You probably mean this loop? Where after the semaphore check the data from a single block will be present in the  L3 scratch. 

    I meant in the loop which processes each range gate ->

    You can still add the transfer of data after the semaphore that you are referring to. But in that case, you need to calculate the offset at which the required range gate starts from.

    Regards,

    Samhitha

  • Hello Samhitha,

    I think you are seeing something like the error shown in the below screenshot -

    I don't see any error as of now, during build my CCS project's linker pulls in a prebuilt .ae66 file located here: 

    • C:\ti\mmwave_mcuplus_sdk_04_07_00_01\mmwave_mcuplus_sdk_04_07_00_01\ti\datapath\dpu\dopplerprocDDMA\lib\libdopplerproc_hwa_ddma_awr2944.ae66

    I can rebuild this .ae66 file by running setenv and then gamke all in the dopplerprocDDMA directory. So that's why I wonder how can I set a breakpoint in this external library (,which I only pull in during linking operations)?

    I meant in the loop which processes each range gate

    That's a very good insight, thank you! One more question concerning this, what is the format of the decompressed outer block which we access here? From what I was able to find it is [numChirps][rangeBinsPerBlock (indexed via rangeBinIdx)][rxAntennas]  is this correct?

    Thanks for your help!

    Mark

  • Hi Mark,

    You can open disassembly, enter the name of the function and place a breakpoint at the start of the function for the first time. This is needed to open the file in CCS. From next run, you can directly place the breakpoint at the required line.

    what is the format of the decompressed outer block which we access here?

    Below is the screenshot of the format of decompressed scratch buffer  -

    Each Range gate includes all the chirps (chirp 0 - Rx0, chirp 0 - Rx1, chirp 0 - Rx2, chirp 0 - Rx3, chirp 1 - Rx0, chirp 1 - Rx1, ...).

    Regards,

    Samhitha

  • Hi Samhitha,

    Thank you for the tip concerning the disassembler. It revealed the reason why only zeros are arriving at my PC (as I am currently outputting the slow-time sequence via TLV for debugging).

    It did reveal that the actual logic inside my condition isn't executed. The problem being that the pointer which I assign inside objetdetection.c doesn't get picked up by the DPU.

    Therefore this condition inside DPU_DopplerProcHWA_process isn't met:

    if (cfg->hwRes.stftInputBuf != NULL){
    }

    Are there any additional considerations (like cache invalidation, or similar) that need to be made when exchanging information/pointers with, a precompiled DPU?

     

     Currently my approach is following:

    1. Inside DPC_ObjDet_preStartConfig I assign (just once) memory for my buffer:
      1. ptrObjDetObj->stftInputBuf = DPC_ObjDet_MemPoolAlloc(L3ramObj, stftInputBuf, sizeof(cmplx16ImRe_t));
        ptrObjDetObj->stftOutputBuf = DPC_ObjDet_MemPoolAlloc(L3ramObj, ptrObjDetObj->stftBufBytes, sizeof(cmplx16ImRe_t));
    2. Inside DPC_ObjDet_dopplerConfig at the top before/after (doesn't change the outcome) memset((void*)dopCfg, 0, sizeof(DPU_DopplerProcHWA_Config)); I do these 2 assignments:
      1. hwRes->stftInputBuf = objDetObj->stftInputBuf;
        hwRes->stftRangeBinIdx = objDetObj->stftRangeBinIndex; 
    3. Inside DPU_DopplerProcHWA_process I have placed my logic inside the discussed for loop under the condition (which is never met):
      1.  if (cfg->hwRes.stftInputBuf != NULL)

    Best regards,

    Mark  

  • Hi Mark,

    Are there any additional considerations (like cache invalidation, or similar) that need to be made when exchanging information/pointers with, a precompiled DPU?

    This is purely dependent on the data and memory location that you are fetching. I would suggest you to step through the code and debug. It's out of the scope of the E2E to debug a custom implementation.

    Regards,

    Samhitha