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.

AWR1243: use fix test pattern mode

Part Number: AWR1243

Hi,

can i use the fix test pattern mode with CSI2 data path?my processor is Zynq UltraScale plus.

In normal mode i can receive data pkg and CP data is correct,Chirp Num is accurately increasing.

in order to verify the data i would like to use test pattern sending fixed data,but No data received,it seems that 1243 does not send any data pkg.  

where did i wrong?

I use the following setting:

/** @fn int Link_testPatternConfig(unsigned char deviceMap)
*
* @brief Test Pattern configuration API.
*
* @param[in] deviceMap - Device Index
*
* @return int Success - 0, Failure - Error Code
*
* Test Pattern configuration API.
*/
int Link_testPatternConfig(unsigned char deviceMap)
{
int retVal = RL_RET_CODE_OK;
/*Test Pattern configuration*/
rltestPattern_t testPatternCfgArgs = {0};
testPatternCfgArgs.numTestPtrnPkts = 128; /* 128 packets */
testPatternCfgArgs.testPatGenCtrl = 0x1; /* Enable */
testPatternCfgArgs.testPatGenTime = 32; /* 100 Clocks (@200 MHZ) */
testPatternCfgArgs.testPatrnPktSize = 256; /* Packet Size */
testPatternCfgArgs.testPatRx0Icfg = 0xA;
testPatternCfgArgs.testPatRx1Icfg = 0xA;
testPatternCfgArgs.testPatRx2Icfg = 0xA;
testPatternCfgArgs.testPatRx3Icfg = 0xA;
testPatternCfgArgs.testPatRx0Qcfg = 0xB;
testPatternCfgArgs.testPatRx1Qcfg = 0xB;
testPatternCfgArgs.testPatRx2Qcfg = 0xB;
testPatternCfgArgs.testPatRx3Qcfg = 0xB;

retVal = rlDeviceSetTestPatternConfig(1U, &testPatternCfgArgs);
if (retVal != RL_RET_CODE_OK)
{
Link_log (Link_LogLevel_ERROR,"Test Pattern config failed for deviceMap %u with error code %d\n",
1, retVal);
return -1;
}
else
{
Link_log (Link_LogLevel_INFO,"Test Pattern config success for deviceMap %u\n", 1);
}
return retVal;
}

  • int MMWL_App_tp()
    {
        int retVal = RL_RET_CODE_OK;
        unsigned char deviceMap = RL_DEVICE_MAP_CASCADED_1;
    
        retVal = MMWL_openConfigFile(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("failed to Open configuration file\n");
            return -1;
        }
    
        /*  \subsection     api_sequence1     Seq 1 - Call Power ON API
        The mmWaveLink driver initializes the internal components, creates Mutex/Semaphore,
        initializes buffers, register interrupts, bring mmWave front end out of reset.
        */
        retVal = MMWL_powerOnMaster(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("mmWave Device Power on failed for deviceMap %u with error %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("mmWave Device Power on success for deviceMap %u \n\n",
                    deviceMap);
        }
    
        /*  \subsection     api_sequence2     Seq 2 - Download FIrmware/patch (Optional)
        The mmWave device firmware is ROMed and also can be stored in External Flash. This
        step is necessary if firmware needs to be patched and patch is not stored in serial
        Flash
        */
    #if (FIRMWARE_DOWNLOAD)
        printf("==========================Firmware Download==========================\n");
        retVal = MMWL_firmwareDownload(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Firmware update failed for deviceMap %u with error %d \n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Firmware update successful for deviceMap %u \n",
                    deviceMap);
        }
        printf("=====================================================================\n");
    #endif
        /* Change CRC Type of Async Event generated by MSS to what is being requested by user in mmwaveconfig.txt */
        retVal = MMWL_setDeviceCrcType(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("CRC Type set for MasterSS failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("CRC Type set for MasterSS success for deviceMap %u \n\n", deviceMap);
        }
    
        /*  \subsection     api_sequence3     Seq 3 - Enable the mmWave Front end (Radar/RF subsystem)
        The mmWave Front end once enabled runs boot time routines and upon completion sends asynchronous event
        to notify the result
        */
        retVal = MMWL_rfEnable(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Radar/RF subsystem Power up failed for deviceMap %u with error %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Radar/RF subsystem Power up successful for deviceMap %u \n\n", deviceMap);
        }
    
        /*  \subsection     api_sequence4     Seq 4 - Basic/Static Configuration
        The mmWave Front end needs to be configured for mmWave Radar operations. basic
        configuration includes Rx/Tx channel configuration, ADC configuration etc
        */
        printf("======================Basic/Static Configuration======================\n");
        retVal = MMWL_basicConfiguration(deviceMap, 0);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Basic/Static configuration failed for deviceMap %u with error %d \n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Basic/Static configuration success for deviceMap %u \n",
                    deviceMap);
        }
    
    if(gLinkTestPatternTest == TRUE)
        {
            printf("==================Data Path(LVDS/CSI2) Configuration==================\n");
            retVal = MMWL_dataPathConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Data Path Configuration failed for deviceMap %u with error %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Data Path Configuration successful for deviceMap %u \n\n", deviceMap);
            }
    
            /*  \subsection     api_sequence9     Seq 9 - CSI2/LVDS CLock and Data Rate Configuration
            User need to configure what data rate is required to send the data on high speed interface. For
            e.g 150mbps, 300mbps etc.
            \ Note - This API is only applicable for AWR1243 when mmWaveLink driver is running on External Host
            */
            retVal = MMWL_hsiClockConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("CSI2/LVDS Clock Configuration failed for deviceMap %u with error %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("CSI2/LVDS Clock Configuration success for deviceMap %u \n\n", deviceMap);
            }
    
            /*  \subsection     api_sequence10     Seq 10 - CSI2/LVDS Lane Configuration
            User need to configure how many LVDS/CSI2 lane needs to be enabled
            \ Note - This API is only applicable for AWR1243 when mmWaveLink driver is running on External Host
            */
            retVal = MMWL_hsiLaneConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("CSI2/LVDS Lane Config failed for deviceMap %u with error %d \n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("CSI2/LVDS Lane Configuration success for deviceMap %u \n",
                        deviceMap);
            }
            MMWL_testPatternConfig(deviceMap);
            printf("======================================================================\n\n");
        }
        else
        {
            /*  \subsection     api_sequence5     Seq 5 - Initializes the mmWave Front end
            The mmWave Front end once configured needs to be initialized. During initialization
            mmWave Front end performs calibration and once calibration is complete, it
            notifies the application using asynchronous event
            */
            retVal = MMWL_rfInit(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("RF Initialization/Calibration failed for deviceMap %u with error code %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("RF Initialization/Calibration successful for deviceMap %u \n", deviceMap);
            }
            printf("======================================================================\n\n");
    
            /*  \subsection     api_sequence6     Seq 6 - FMCW profile configuration
            TI mmWave devices supports Frequency Modulated Continuous Wave(FMCW) Radar. User
            Need to define characteristics of FMCW signal using profile configuration. A profile
            contains information about FMCW signal such as Start Frequency (76 - 81 GHz), Ramp
            Slope (e.g 30MHz/uS). Idle Time etc. It also configures ADC samples, Sampling rate,
            Receiver gain, Filter configuration parameters
    
            \ Note - User can define upto 4 different profiles
            */
            printf("======================FMCW Configuration======================\n");
            retVal = MMWL_profileConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Profile Configuration failed for deviceMap %u with error code %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Profile Configuration success for deviceMap %u \n\n", deviceMap);
            }
    
            /*  \subsection     api_sequence7     Seq 7 - FMCW chirp configuration
            A chirp is always associated with FMCW profile from which it inherits coarse information
            about FMCW signal. Using chirp configuration user can further define fine
            variations to coarse parameters such as Start Frequency variation(0 - ~400 MHz), Ramp
            Slope variation (0 - ~3 MHz/uS), Idle Time variation etc. It also configures which transmit channels to be used
            for transmitting FMCW signal.
    
            \ Note - User can define upto 512 unique chirps
            */
            retVal = MMWL_chirpConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Chirp Configuration failed for deviceMap %u with error %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Chirp Configuration success for deviceMap %u \n\n", deviceMap);
            }
    
        /*  \subsection     api_sequence8     Seq 8 - Data Path (CSI2/LVDS) Configuration
        TI mmWave device supports CSI2 or LVDS interface for sending RAW ADC data. mmWave device
        can also send Chirp Profile and Chirp Quality data over LVDS/CSI2. User need to select
        the high speed interface and also what data it expects to receive.
    
        \ Note - This API is only applicable for AWR1243 when mmWaveLink driver is running on External Host
        */
    
    #ifdef ENABLE_TEST_SOURCE
        retVal = MMWL_testSourceConfig(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Test Source Configuration failed for deviceMap %u with error %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Test source Configuration success for deviceMap %u \n\n", deviceMap);
        }
    #endif
    
    #if 0
        rlDeviceSetInternalConf(deviceMap, 0x50060230,0x4320010);
        rlDeviceSetInternalConf(deviceMap, 0x50060238,0x3E080800);
        rlDeviceSetInternalConf(deviceMap, 0x50060224,0xE8001);
        rlDeviceSetInternalConf(deviceMap, 0x50060220,0xFF0);
    #endif
    
        /* Check for If Advance Frame Test is enabled */
        if(gLinkAdvanceFrameTest == FALSE)
        {
            /*  \subsection     api_sequence11     Seq 11 - FMCW frame configuration
            A frame defines sequence of chirps and how this sequence needs to be repeated over time.
            */
            retVal = MMWL_frameConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Frame Configuration failed for deviceMap %u with error %d \n",
                    deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Frame Configuration success for deviceMap %u \n", deviceMap);
            }
        }
        else
        {
            /*  \subsection     api_sequence11     Seq 11 - FMCW Advance frame configuration
            A frame defines sequence of chirps and how this sequence needs to be repeated over time.
            */
            retVal = MMWL_advFrameConfig(deviceMap);
    
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Adv Frame Configuration failed for deviceMap %u with error %d \n",
                    deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Adv Frame Configuration success for deviceMap %u \n", deviceMap);
            }
        }
        printf("======================================================================\n\n");
    
        if (gLinkContModeTest == TRUE)
        {
            retVal = MMWL_setContMode(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Continuous mode Config failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Continuous mode Config successful for deviceMap %u \n\n", deviceMap);
            }
        }
        /*  \subsection     api_sequence12     Seq 12 - Start mmWave Radar Sensor
        This will trigger the mmWave Front to start transmitting FMCW signal. Raw ADC samples
        would be received from Digital front end. For AWR1243, if high speed interface is
        configured, RAW ADC data would be transmitted over CSI2/LVDS. On xWR1443/xWR1642, it can
        be processed using HW accelerator or DSP
        */
        retVal = MMWL_sensorStart(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Sensor Start failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Sensor Start successful for deviceMap %u \n\n", deviceMap);
        }
        printf("======================================================================\n\n");
    
        if (gLinkDynProfileTest == TRUE)
        {
            /* Host can update profile configurations dynamically while frame is ongoing.
               This test has been added in this example to demostrate dynamic profile update feature
               of mmWave sensor device, developer must check the validity of parameters at the system
               level before implementing the application. */
    
            /* wait for few frames worth of time before updating profile config */
            osiSleep(3*framePeriodicity);
    
            /* update few of existing profile parameters */
            profileCfgArgs[0].rxGain = 222;
            profileCfgArgs[0].pfCalLutUpdate = 0x1; /* bit0: 1, bit1: 0 */
            profileCfgArgs[0].hpfCornerFreq1 = 1;
            profileCfgArgs[0].hpfCornerFreq2 = 1;
            profileCfgArgs[0].txStartTime = 2;
            profileCfgArgs[0].rampEndTime = 7000;
    
            /* Dynamically configure 1 profile (max 4 profiles) while frame is ongoing */
            retVal = rlSetProfileConfig(deviceMap, 1U, &profileCfgArgs[0U]);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Dynamic Profile Configuration failed for deviceMap %u with error code %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Dynamic Profile Configuration success for deviceMap %u \n\n", deviceMap);
            }
    
            /* wait for few frames worth of time before reading profile config.
               Dynamic profile configuration will come in effect during next frame, so wait for that time
               before reading back profile config */
            osiSleep(2*framePeriodicity);
    
            /* To verify that profile configuration parameters are applied to device while frame is ongoing,
               read back profile configurationn from device */
            retVal = rlGetProfileConfig(deviceMap, 0, &profileCfgArgs[1]);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Dynamic Get Profile Configuration failed for deviceMap %u with error code %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Dynamic Get Profile Configuration success for deviceMap %u \n\n", deviceMap);
                /* compare the read back profile configuration parameters to lastly configured parameters */
                if ((profileCfgArgs[0].rxGain != profileCfgArgs[1].rxGain) || \
                    (profileCfgArgs[0].hpfCornerFreq1 != profileCfgArgs[1].hpfCornerFreq1) || \
                    (profileCfgArgs[0].hpfCornerFreq2 != profileCfgArgs[1].hpfCornerFreq2) || \
                    (profileCfgArgs[0].txStartTime != profileCfgArgs[1].txStartTime) || \
                    (profileCfgArgs[0].rampEndTime != profileCfgArgs[1].rampEndTime))
                    printf("Dynamic Profile Config mismatched !!! \n\n");
                else
                    printf("Dynamic profile cfg matched \n\n");
            }
        }
    
        if (gLinkDynChirpTest == TRUE)
        {
            /* wait for few frames to elapse before invoking Dynamic chirp config API to update
               new chirp config to come in effect for next frames */
    
            /* wait for few frames worth of time */
            osiSleep(3*framePeriodicity);
    
            retVal = MMWL_setDynChirpConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Dynamic Chirp config failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Dynamic Chirp config successful for deviceMap %u \n\n", deviceMap);
            }
            printf("======================================================================\n\n");
    
            retVal = MMWL_dynChirpEnable(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("Dynamic Chirp Enable failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("Dynamic Chirp Enable successful for deviceMap %u \n\n", deviceMap);
            }
            printf("======================================================================\n\n");
    
            /* wait for another few mSec so that dynamic chirp come in effect,
             If above API reached to BSS at the end of frame then new chirp config will come in effect
             during next frame only */
            osiSleep(2*framePeriodicity);
    
            /* read back Chirp config, which should be same as configured in dynChirpConfig for same segment */
            retVal = MMWL_getDynChirpConfig(deviceMap);
            if (retVal != RL_RET_CODE_OK)
            {
                printf("GetChirp Configuration failed for deviceMap %u with error %d \n\n",
                        deviceMap, retVal);
                return -1;
            }
            else
            {
                printf("GetChirp Configuration success for deviceMap %u \n\n", deviceMap);
            }
        }
    
        /* @Note - all these SLeep is added in this demo application to demonstrate mmWave sensor features,
                    user can change these sleep time values as per their requirement */
    
        /* wait for 10 frames worth of time */
        osiSleep(10*framePeriodicity);
    
        /* Stop the frame */
        retVal = MMWL_sensorStop(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            if (retVal == RL_RET_CODE_FRAME_ALREADY_ENDED)
            {
                printf("Frame is already stopped when sensorStop CMD was issued\n");
            }
            else
            {
                printf("Sensor Stop failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
                return -1;
            }
        }
        else
        {
            printf("Sensor Stop successful for deviceMap %u \n\n", deviceMap);
        }
    
        /* Note- Before Calling this API user must feed in input signal to device's pins,
        else device will return garbage data in GPAdc measurement over Async event.
        Measurement data is stored in 'rcvGpAdcData' structure after this API call. */
        retVal = MMWL_gpadcMeasConfig(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("GPAdc measurement API failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("GPAdc measurement API success for deviceMap %u \n\n", deviceMap);
        }
    
        /* Switch off the device */
        retVal = MMWL_powerOff(deviceMap);
        if (retVal != RL_RET_CODE_OK)
        {
            printf("Device power off failed for deviceMap %u with error code %d \n\n",
                    deviceMap, retVal);
            return -1;
        }
        else
        {
            printf("Device power off success for deviceMap %u \n\n", deviceMap);
        }
        }
    
        return 0;
    }

  • Hi Min,

    With CSI, you will not be able to use the test pattern.

    But you can use the test source to generate a good test pattern data. You can configure the test source to generate an object with 0 velocity.

    The test source pattern will be different across chirps, but it will repeat across frames. So you can configure a small number of chirps if you like.

    An example configuration can be like the following image.

    Best Regards,

    Anand

  • Hi,Anand
    Thanks very much,i will try the TestSource mode.