I am trying to inject a recorded radar cube into the DSS processing chain in order to debug the DSP AoA algorithm. It isn't working -- it appears that data is not initialized and I get all zeros as output. I am wondering what I am doing wrong.
In dss_main following the example in the sdk_user_guide, I have:
#define TEST_RADAR_CUBE_SIZE 12288 #define TEST_RADAR_CUBE_ALIGNMENT 8 /*! L3 RAM buffer for object detection DPC */ uint8_t gMmwL3[SOC_L3RAM_SIZE - TEST_RADAR_CUBE_SIZE*sizeof(cmplx16ImRe_t) - TEST_RADAR_CUBE_ALIGNMENT]; #pragma DATA_SECTION(gMmwL3, ".l3ram"); #pragma DATA_SECTION(testRadarCube, ".l3data_testradarcube"); #pragma DATA_ALIGN(testRadarCube, TEST_RADAR_CUBE_ALIGNMENT); #include <ti/datapath/dpc/dpu/dopplerproc/include/testradarcube.h>
where testradarcube.h has the definition:
const cmplx16ImRe_t __attribute__((used)) testRadarCube[TEST_RADAR_CUBE_SIZE] = { {96, -136}, {-179, 229}, {144, -169}, {10, 87}, {-66, -70}, {11, 41}, {1, -2}, {55, -15}, {-97, 16}, {82, -9}, {-39, 2}, {6, -7}, {10, 15}, {-7, -7}, {-6, -5}, ... }
In dopplerprocdsp.c, I have
#define TEST_RADAR_CUBE_SIZE 12288 extern const cmplx16ImRe_t testRadarCube[TEST_RADAR_CUBE_SIZE]; int32_t DPU_DopplerProcDSP_process ( DPU_DopplerProcDSP_Handle handle, DPU_DopplerProcDSP_OutParams *outParams ) { DPU_DopplerProcDSP_Obj *obj; DPU_DopplerProcDSP_Config *cfg; uint16_t rxAntIdx, rangeIdx, txAntIdx; uint16_t nextTransferRxIdx, nextTransferRangeIdx, nextTransferTxIdx; uint16_t rxAntIdxBPMPreviousBuffer, txAntIdxBPMPreviousBuffer; uint32_t nextTransferIdx, waitingTime, pingPongIdx; volatile uint32_t startTime; volatile uint32_t startTimeWait; int32_t *fftOutPtr; int32_t retVal; uint8_t channel; cmplx16ImRe_t *inpDoppFftBuf; cmplx16ImRe_t *radarCubeBase; cmplx32ReIm_t *windowingOutBuf; retVal = 0; waitingTime = 0; obj = (DPU_DopplerProcDSP_Obj *)handle; if (obj == NULL) { retVal = DPU_DOPPLERPROCDSP_EINVAL; goto exit; } if(obj->inProgress == true) { retVal = DPU_DOPPLERPROCDSP_EINPROGRESS; goto exit; } else { obj->inProgress = true; } startTime = Cycleprofiler_getTimeStamp(); radarCubeBase = (cmplx16ImRe_t *)obj->cfg.hwRes.radarCube.data; cfg = &obj->cfg; dspDpu_setRadarCubeDSP(handle); //rest of file is as normal ... }
The function dspDpu_setRadarCubeDSP looks like this:
#pragma FUNCTION_OPTIONS(dspDpu_setRadarCubeDSP, "-O0") void dspDpu_setRadarCubeDSP( DPU_DopplerProcDSP_Handle handle ) { size_t testRadarCubeSize; DPU_DopplerProcDSP_Obj *obj; volatile cmplx16ImRe_t *radarCubeBase; // Setup obj = (DPU_DopplerProcDSP_Obj *)handle; radarCubeBase = (cmplx16ImRe_t *)obj->cfg.hwRes.radarCube.data; // Copy over testRadarCubeSize = sizeof(testRadarCube); // Size of testRadarCube array in bytes memcpy((void*)radarCubeBase, (void*)testRadarCube, testRadarCubeSize); return; }
My mmw_dss_linker.cmd file looks like
/*----------------------------------------------------------------------------*/ /* Linker Settings */ --retain="*(.intvecs)" /*----------------------------------------------------------------------------*/ /* Section Configuration */ SECTIONS { systemHeap : {} >> L2SRAM_UMAP0 | L2SRAM_UMAP1 .l3ram: {} >> L3SRAM .l3data_testradarcube : { *(.l3data_testradarcube) } load = L3SRAM PAGE 0 (HIGH) .dpc_l1Heap : { } > L1DSRAM .dpc_l2Heap: { } >> L2SRAM_UMAP0 | L2SRAM_UMAP1 .demoSharedMem: { } >> HSRAM } /*----------------------------------------------------------------------------*/
And the map file shows the test cube:
MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- PAGE 0: ... L3SRAM 20000000 000c0000 000bfff8 00000008 RWIX ... SEGMENT ALLOCATION MAP run origin load origin length init length attrs members ---------- ----------- ---------- ----------- ----- ------- ... 20000000 20000000 000b3ff8 00000000 rw- .l3ram 200b4000 200b4000 0000c000 0000c000 r-- 200b4000 200b4000 0000c000 0000c000 r-- .l3data_testradarcube ... SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- ... .l3data_testradarcube * 0 200b4000 0000c000 200b4000 0000c000 dss_main.oe674 (.l3data_testradarcube) ... GLOBAL SYMBOLS: SORTED BY Symbol Address address name ------- ---- ... ... 20000000 gMmwL3 200b4000 testRadarCube 21080000 gHSRAM ... ...
It all compiles just fine. So I think the memcpy should work -- but when I output the radar cube, I get all zeros. Why? What am I doing wrong?