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.

[FAQ] IWRL6432: Exporting the radar cube over UART

Part Number: IWRL6432

Introduction

When developing a product with the IWRL6432, some tasks may benefit from the ability to stream off the radar cube from the device. In certain scenarios, this may be possible over UART instead of the typical DCA1000 recommendation. These applications may include the following:

1. Advanced angle calibration techniques

2. Radome design and testing

3. RF measurement

4. Algorithmic development for advanced signal processing techniques

Configuration File Changes

Data throughput

To stream the radar cube data off the device, first make sure that the frame rate can support it. In this example, only the major motion radar cube is streamed off, which has the following size:

dataSize = number of Range bins * number of Virtual Antennas * Number of Doppler Chirps per frame * 4 bytes (size of the cmplx16ReIm_t).

        gMmwMssMCB.radarCube[0].dataSize = params->numRangeBins * params->numVirtualAntennas * sizeof(cmplx16ReIm_t) * params->numDopplerChirpsPerProc;

The frame rate specified in the frameCfg line in the configuration file must be slow enough to broadcast this entire cube.

Frame Rate < (Data size in bytes * 8) / (Baud Rate in bits/sec)

In the attached cfg, the frame rate is 250 msec, and the size of the radar cube is the following:

Radar cube size = (256-point real-only FFT = 128 range bins) * (6 virtual antennas enabled) * (32 doppler chirps) * (4 bytes/sample) = 98304 bytes.

Baud Rate = 1250000 bits/sec

Time needed = 78 msec.

So, accounting for processing time and time to send the rest of the UART message, a conservative frame period of 250 ms should be enough.

frameCfg 2 0 250 32 250 0

Low Power

To ensure that the device doesn't try to enter/exit deep sleep, which it may not have enough time to do with the higher UART throughput, set

lowPowerCfg 0

baudRate

Setting a higher baud rate (maximum of 1.25 Mbaud) will allow larger volumes of data transmission. Set 

baudRate 1250000

Below is an example of a working cfg file.

/cfs-file/__key/communityserver-discussions-components-files/1023/export_5F00_radarcube_5F00_example.cfg

Software modifications

Make the following changes to the software

1. Comment out the creation of the CLI_defaultcfg_task in the motion_detect() function of the mmw_cli.c file

    /* DPC initialization*/
    DPC_Init();

    CLI_init(CLI_TASK_PRIORITY);

    // Create a Task for running default configuration
//    gDefCfgTask = xTaskCreateStatic( CLI_defaultcfg_task,      /* Pointer to the function that implements the task. */
//                                  "Run_Defaultcfg",          /* Text name for the task.  This is to facilitate debugging only. */
//                                  DEFAULT_CFG_TASK_SIZE,  /* Stack depth in units of StackType_t typically uint32_t on 32b CPUs */
//                                  NULL,            /* We are not using the task parameter. */
//                                  DEFAULT_CFG_TASK_PRI,   /* task priority, 0 is lowest priority, configMAX_PRIORITIES-1 is highest */
//                                  gDefCfgTaskStack,  /* pointer to stack base */
//                                  &gDefCfgTaskObj ); /* pointer to statically allocated task object memory */
    
    /* Never return for this task. */
    SemaphoreP_pend(&gMmwMssMCB.demoInitTaskCompleteSemHandle, SystemP_WAIT_FOREVER);

2. In the mmwDemo_TransmitProcessedOutputTask() function in the motion_detect.c file, allocate for the radar cube in the UART message

        uDopplerData = (uint8_t*) result->microDopplerOutParams.uDopplerOutput;
        uDopplerFeatures = (uint8_t*) result->microDopplerOutParams.uDopplerFeatures;
        uClassifierOutput = (uint8_t*) &result->microDopplerOutParams.classifierOutput;

        numDopplerBins = result->microDopplerOutParams.numDopplerBins;

        packetLen = sizeof(MmwDemo_output_message_header);
        /* Start modification to stream radarcube over UART */
        if (1)
        {
            tl[tlvIdx].type = MMWDEMO_OUTPUT_EXT_RADAR_CUBE;
            tl[tlvIdx].length = gMmwMssMCB.radarCube[0].dataSize;
            packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;
            tlvIdx++;
        }
        /* End modification to stream radarcube over UART */

        if ((pGuiMonSel->pointCloud == 1) && (result->numObjOut > 0))
        {
            tl[tlvIdx].type = MMWDEMO_OUTPUT_MSG_DETECTED_POINTS;
            tl[tlvIdx].length = sizeof(DPIF_PointCloudCartesian) * result->numObjOut;
            packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;
            tlvIdx++;
        }

3. In the mmwDemo_TransmitProcessedOutputTask() function in the motion_detect.c file, stream the radar cube in the UART message

       if(tlvIdx != 0)
        {
            mmw_UartWrite (uartHandle, (uint8_t*)&header, sizeof(MmwDemo_output_message_header));
            tlvIdx = 0;
        }

        /* Start modification to stream radarcube over UART */
        if (1)
        {
            mmw_UartWrite (uartHandle,
                            (uint8_t*)&tl[tlvIdx],
                            sizeof(MmwDemo_output_message_tl));

            /*Send array of objects */
            mmw_UartWrite (uartHandle, (uint8_t*)gMmwMssMCB.radarCube[0].data,
                           gMmwMssMCB.radarCube[0].dataSize);
            tlvIdx++;

        }
        /* End modification to stream radarcube over UART */

        /* Send detected Objects */
        if ((pGuiMonSel->pointCloud == 1) && (result->numObjOut > 0))
        {

4. In the MmwDemo_output_message_type definition in motion_detect.h, add the following data type.

    /*! @brief   Classifier info */
    MMWDEMO_OUTPUT_EXT_MSG_CLASSIFIER_INFO,

    /*! @brief   Rx Channel compensation info */
    MMWDEMO_OUTPUT_EXT_MSG_RX_CHAN_COMPENSATION_INFO,

    /* Start modification to stream radarcube over UART */
    MMWDEMO_OUTPUT_EXT_RADAR_CUBE,
    /* End modification to stream radarcube over UART */

    MMWDEMO_OUTPUT_EXT_MSG_MAX

} MmwDemo_output_message_type;

Data output format:

The output data should be formatted as a cmplx16ImRe_t_, which has 16-bit signed integer values for the imaginary and real parts of the complex number. The data format will vary first by range, then antenna, then chirp.

X[chirp][antenna][range]

The data in the radarcube is NOT ADC DATA. It is the output of the windowing and range FFT operations. The windowing function used can be found in the math_utils.c/.h files, and it is the Blackman window by default.