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.

IWR1443BOOST: error parsing raw ADC data dump using MATLAB

Part Number: IWR1443BOOST


I'm trying to use the MATLAB script defined in 6.1 of this guide to parse a memory capture received with the mmWave SDKv1.2 mem_capture test code (using the default settings). However, when I try to run the script I get this error:

Error using reshape: Product of known dimensions, 8, not divisible into total number of elements, 196621.

Since the script only really has one variable that users should modify (numADCBits) and I'm pretty sure it is correctly set to 16, I am not sure what the problem is. I have attached the mem_capture.dat file that I am trying to read. I followed the instructions in Section 2 to save the memory capture. My settings were"

131072 = Length in Words = Total Size / 2 bytes per word

 Total Size in Bytes = Num ADC Samples × Num RX Channels × Num Frames × Num Chirps × Num Bytes Per Sample

 262144 = 256 * 2 * 1 * 1 * 128 * 4 

mem_capture.dat

  • Hi Colleen,

    You can see that the size of the adcData array is much larger than the size you expected. Make sure you are copying the right amount of data from CCS. Also, check you chirp configuration and ensure that you are using 16 bit complex data and a chirp configuration with 1 Tx.

    Regards,
    Justin
  • Hi Justin,

    I'm using the formula specified in the user guide to determine how many words to copy:  (Num ADC Samples × Num RX Channels × Num Frames × Num Chirps × Num Bytes Per Sample)/2

    I'm using the default settings in the mem_capture mss.c code, which from what I can tell enables only the Ch 0 Tx via chCfg.txChannelEn = 1U, and 16-bit complex ADC output via adcOutCfg.fmt.b2AdcBits = 2U and adcOutCfg.fmt.b2AdcOutFmt = 2U.

    static void MemCapture_initLinkChirpCfgParams (rlChirpCfg_t* ptrChirpCfg)
    {
        /* Initialize the chirp configuration: */
        memset ((void *)ptrChirpCfg, 0, sizeof(rlChirpCfg_t));
    
        /* Populate the chirp configuration: */
        ptrChirpCfg->chirpStartIdx   = 0U;
        ptrChirpCfg->chirpEndIdx     = 0U;
        ptrChirpCfg->profileId       = 0U;
        ptrChirpCfg->startFreqVar    = (uint32_t)(0U * (1U << 26) / (3.6 * 1e3)); /* in MHz */
        ptrChirpCfg->freqSlopeVar    = (uint16_t)(0U * (1U << 26) / (3.6*1e6*900)); /* in KHz/usec */
        ptrChirpCfg->idleTimeVar     = (uint32_t)(0U * 1000 / 10);
        ptrChirpCfg->adcStartTimeVar = (uint32_t)(0U * 1000 / 10);
        ptrChirpCfg->txEnable        = 1U;
    }
    
    static void MemCapture_initMMWaveOpenParams (MMWave_OpenCfg* ptrOpenCfg)
    {
        /* Initialize the open configuration: */
        memset ((void*)ptrOpenCfg, 0, sizeof(MMWave_OpenCfg));
    
        /* Populate the open configuration: */
        ptrOpenCfg->freqLimitLow                        = 760U;
        ptrOpenCfg->freqLimitHigh                       = 810U;
        ptrOpenCfg->chCfg.rxChannelEn                   = 2U;
        ptrOpenCfg->chCfg.txChannelEn                   = 1U;
        ptrOpenCfg->chCfg.cascading                     = 0U;
        ptrOpenCfg->lowPowerMode.lpAdcMode              = 0U;
        ptrOpenCfg->adcOutCfg.fmt.b2AdcBits             = 2U;
        ptrOpenCfg->adcOutCfg.fmt.b2AdcOutFmt           = 2U;
        ptrOpenCfg->disableFrameStartAsyncEvent         = false;
        ptrOpenCfg->disableFrameStopAsyncEvent          = false;    
    }
    

    When I save the CCS data I use the 16-bit HEX TI Style format and my start address is gDataCube=0x51020000. The number of words I read is calculated as per my original post. I believe I have confirmed the number of RX channels and the number of bytes per sample. Based on these lines of code in mss.c, I set the num ADC samples to 256 and num frames to 1 and num chirps to 128. 

    ptrProfileCfg->numAdcSamples = 256;

    ptrFrameCfg->chirpStartIdx = 0U;
    ptrFrameCfg->chirpEndIdx = 0U;
    ptrFrameCfg->numLoops = 128;
    ptrFrameCfg->numFrames = 1;

    The number of frames and ADC samples seems obvious, but I am not confident about the num Chirps. I am basing it off this code that I found elsewhere in the SDK:

       numChirpsPerFrame = (gCSIStreamMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.chirpEndIdx -gCSIStreamMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.chirpStartIdx + 1) *gCSIStreamMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.numLoops;

    Here is the save memory dialog that I filled out:

    The memory in words that I am copying is the same as what the equation says. I have double checked the equation, but I'm having trouble seeing which of the values might be incorrect.

  • Hi Colleen,

    There are 256 samples per chirp, and 128 chirps. Each sample is 4 bytes, so total data size per frame is 131072 bytes. (128*256*4). The CCS dialog box is reading 131072 words, and each word is specified as 16-Bit hex style, so you are reading 262144 bytes. Instead, try reading 65536 words. This should give you the correct amount of data.

    Regards,
    Justin
  • Hi Colleen,

    Did this resolve your issue?

    Regards,
    Justin