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.

IWR6843ISK-ODS: MMWave_config MMWAVE_EPROFILECFG

Part Number: IWR6843ISK-ODS

Hello!

I'm developing function that would perform Radar configuration without CLI util. As a reference I use source code frome ods_point_cloud_68xx_hwa lab.

I did all the neccessary init and configuration steps up to DPM_int and launching DPM execute task.

I'm trying to open and configure Radar SS using MMWave API.

I launch MMWave_open and it returns 0 (succsessful).

I also do create and fill profileCfg, call MMWave_addProfile, create and fill chirpCfg, call MMWave_addChirp, then I create and fill rlFrameCfg_t, add to MMWave_CtrlCfg instance

After that I launch MMWave_config and it return -1, error code (after 16bit shift) is -3108 - MMWAVE_EPROFILECFG.

I traced MMWave_config call stack, and found out that my error is probably caused by RL_RET_CODE_INVALID_STATE_ERROR in function rlDriverCmdInvoke in rl_driver.c.

Could you, please, help me up resolving this issue?

Here is my code for sensorConfig_task:

Void sensorConfig_task(UArg arg0, UArg arg1) {
    MMWave_OpenCfg      openCfg;       
    MMWave_CtrlCfg      ctrlCfg;       
    int32_t retVal, errCode;

    retVal = MMWave_stop(mmwControlHandle, &errCode);
    if (retVal < 0 )
        printf("MMWave_stop errCode %d\n", errCode >> 16);

// ----------- open  MMWave

    openCfg.freqLimitLow = 0U;
    openCfg.freqLimitHigh = 0U;

    openCfg.disableFrameStartAsyncEvent = false;
    openCfg.disableFrameStopAsyncEvent = false;

    openCfg.useCustomCalibration = false;
    openCfg.customCalibrationEnableMask = 0x0;


    rlChanCfg_t chCfg;
    chCfg.rxChannelEn = 15;
    chCfg.txChannelEn = 7; 
    chCfg.cascading = 0;  
    openCfg.chCfg = chCfg;

    openCfg.adcOutCfg.fmt.b2AdcBits = 2; 
    openCfg.adcOutCfg.fmt.b2AdcOutFmt = 1;

    openCfg.lowPowerMode.lpAdcMode = 0;   

    openCfg.defaultAsyncEventHandler = MMWave_DefaultAsyncEventHandler_MSS;
    openCfg.calibMonTimeUnit  = 1U;

    retVal = MMWave_open(mmwControlHandle, &openCfg, NULL, &errCode);
    if (retVal < 0){
        printf("MMWave_open error code %d\n", errCode >> 16);
    }
    else{
        printf("MMWave_open successful!!\n");
    }
// --------------

// -------------- preparing for MMWave_config call
 
    rlProfileCfg_t profileCfg;
    profileCfg.profileId = 0; 
    profileCfg.startFreqConst = 60;
    profileCfg.idleTimeConst = 7;  
    profileCfg.adcStartTimeConst = 3;
    profileCfg.rampEndTime = 24;
    profileCfg.txOutPowerBackoffCode = 0;
    profileCfg.txPhaseShifter = 0;
    profileCfg.freqSlopeConst = 156;
    profileCfg.txStartTime = 1;
    profileCfg.numAdcSamples = 256;
    profileCfg.digOutSampleRate = 12500;
    profileCfg.hpfCornerFreq1 = 0x0;
    profileCfg.hpfCornerFreq2 = 0x0;
    profileCfg.rxGain = 30;
    profileCfg.txCalibEnCfg = 7;

    MMWave_ProfileHandle profile_handle_1;
    profile_handle_1 = MMWave_addProfile(mmwControlHandle, &profileCfg, &errCode);

    uint32_t np;
    retVal = MMWave_getNumProfiles(mmwControlHandle, &np, &errCode);

    rlChirpCfg_t chirpCfg[3];
    int8_t i;
    for (i = 0; i < 3; i++)
    {
        chirpCfg[i].chirpStartIdx = i;
        chirpCfg[i].chirpEndIdx = i;
        chirpCfg[i].profileId = 0;
        chirpCfg[i].startFreqVar = 0;
        chirpCfg[i].freqSlopeVar = 0;
        chirpCfg[i].idleTimeVar = 0;
        chirpCfg[i].adcStartTimeVar = 0;
    }
    chirpCfg[0].txEnable = 0b001;       
    chirpCfg[1].txEnable = 0b010;       
    chirpCfg[2].txEnable = 0b100;       

    MMWave_ChirpHandle chirps[3];
    for (i = 0; i < 3; i++)
    {
        chirps[i] = MMWave_addChirp(profile_handle_1, &chirpCfg[i], &errCode);
    }

    rlFrameCfg_t frameCfg;
    frameCfg.chirpStartIdx = 0;
    frameCfg.chirpEndIdx = 2; 
    frameCfg.numLoops = 32;
    frameCfg.numFrames = 0;       
    frameCfg.framePeriodicity = 100;
    frameCfg.triggerSelect = 1;
    frameCfg.frameTriggerDelay = 0;
    frameCfg.numDummyChirpsAtEnd = 0;

    ctrlCfg.dfeDataOutputMode = MMWave_DFEDataOutputMode_FRAME;
    ctrlCfg.u.frameCfg.profileHandle[0] = profile_handle_1;
    ctrlCfg.u.frameCfg.frameCfg = frameCfg;

    retVal = MMWave_config(mmwControlHandle, &ctrlCfg, &errCode);
    if (retVal < 0)
    {
        printf("MMWave_config error code %d\n", errCode >> 16);
    }

___

Denis

  • Former Member
    0 Former Member

    Hello,

    What SDK version are you using?

    Amanda

  • Hello,

    I'm using sdk 3.3 - mmwave_sdk_03_03_00_03.

  • Former Member
    0 Former Member in reply to Denis Nacharov

    Hello Denis,

    I would recommend you refer to

    static int32_t CLI_MMWaveProfileCfg (int32_t argc, char* argv[])

    in cli_mmwave.c. You cannot use the save values that worked in the profileCfg CLI command as is. The units need to be translated as performed in the function I referred you to. Example below:

    /* Translate from GHz to [1 LSB = gCLI_mmwave_freq_scale_factor * 1e9 / 2^26 Hz] units
    * of mmwavelink format */
    profileCfg.startFreqConst = (uint32_t) (atof(argv[2]) * (1U << 26) /
    gCLI_mmwave_freq_scale_factor);

    /* Translate below times from us to [1 LSB = 10 ns] units of mmwavelink format */
    profileCfg.idleTimeConst = (uint32_t)((float)atof(argv[3]) * 1000 / 10);
    profileCfg.adcStartTimeConst = (uint32_t)((float)atof(argv[4]) * 1000 / 10);
    profileCfg.rampEndTime = (uint32_t)((float)atof(argv[5]) * 1000 / 10);

    You need to make sure your inputs in your hardcoded config are also translated.

    Amanda

  • Hello, Amanda,

    thank you very much!

    This resolve the issue.

    After fixing config units, i struggled little bit with

    E_dataAbort: pc = 0x00018390, lr = 0x000163ab.
    xdc.runtime.Error.raise: terminating execution

    because I was configuring only one profile.

    But when I forced other profiles in ctrlCfg.u.frameCfg to NULL, that error was gone and MMWave_config finally returned 0 (successful).