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.

Compiler/AWR1642BOOST: Editing the CLI Script to accommodate new BPM Scheme

Part Number: AWR1642BOOST


Tool/software: TI C/C++ Compiler

Hi Jitendra,

In our previous thread, you said that the additional two chirps in the firmware looked fine. Now, I need to specifically identify them in the CLI script, so I would need to add two additional entries in the CLI script (i.e. <chirp2Idx> and <chirp3Idx>). Therefore, my CLI script would look something like: [bpmCfg -1 1 0 1 2 3] instead of [bpmCfg -1 1 0 1] in the two chirp BPM case. Is there anything I should consider when I include more entries for an API in the CLI script, like editing the cli_mmwve.c code to include the chirpEndIdx to be the arg[4] value? 

sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 1 0
adcCfg 2 1
adcbufCfg -1 0 0 1 0
profileCfg 0 77 7 7 160 0 0 20 1 512 6200 0 0 30
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 1
chirpCfg 2 2 0 0 0 0 0 1
chirpCfg 3 3 0 0 0 0 0 1
bpmCfg -1 1 0 1 2 3
frameCfg 0 3 16 480 250 1 0
lowPower 0 1
guiMonitor -1 0 0 0 0 0 0
cfarCfg -1 0 2 8 4 4 0 5120
cfarCfg -1 1 0 8 4 4 0 5120
peakGrouping -1 1 0 0 1 224
multiObjBeamForming -1 0 0.5
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 0
clutterRemoval -1 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
nearFieldCfg -1 0 0 0
CQRxSatMonitor 0 3 4 127 0
CQSigImgMonitor 0 63 8
analogMonitor 0 0
lvdsStreamCfg -1 0 1 0
sensorStart

Above is my CLI script to see the bpmCfg API with everything else.

George

  • Hi,

    Please trace in the original demo code how the API entries are processed.

    The code was not designed to be extended and it is possible that the code makes additional assumptions. Based on the description it seems that the  code assumes that the first BPM chirp will have phase 0 and second chirp phase 180. If you add additional chirps I am not sure how the code will handle this.

    Please review in mss_main.c the function MmwDemo_bpmConfig()

    Thank you

    Cesar

  • Hi Cesar,

    Will do. As I was looking through, I noticed something that I could not figure out...

    In the CLI_MMWaveBPMCfgAdvanced section of the cli_mmwave.c code, the inputs expected are <chirpStartIdx>, <ChirpEndIdx>, and <constBpmVal> from the CLI script, which is not what is from the CLI script (as per the SDK). Rather, the bpmCfg API in the SDK for the CLI script has arguments <subFrameIdx>, <enabled>, <chirp0Idx>, and <chirp2Idx>, which are used in the mss_main.c code. So where does the bpmCfgAdvanced come into play?

    All code below for the specific sections.

    cli_mmwave.c

            "bpmCfgAdvanced",
    #ifdef CLI_MMWAVE_HELP_SUPPORT
            "<chirpStartIdx> <chirpEndIdx> <constBpmVal>",
    #else
            NULL,
    #endif
            CLI_MMWaveBPMCfgAdvanced
        },
        {
            NULL,
            NULL,
            NULL
        }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for the BPM configuration.
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  \ingroup CLI_UTIL_INTERNAL_FUNCTION
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t CLI_MMWaveBPMCfgAdvanced (int32_t argc, char* argv[])
    {   
        rlBpmChirpCfg_t         bpmChirpCfg;
        int32_t                 errCode;
          
        /* Sanity Check: Minimum argument check */
        if (argc != 4)
        {
            CLI_write ("Error: Invalid usage of the CLI command\n");
            return -1;
        }
    
        /* Sanity Check: BPM Chirp configuration is valid only for the Frame or
                         Advanced Frame Mode: */
        if ((gCLIMMWaveControlCfg.dfeDataOutputMode != MMWave_DFEDataOutputMode_FRAME) &&
            (gCLIMMWaveControlCfg.dfeDataOutputMode != MMWave_DFEDataOutputMode_ADVANCED_FRAME))
        {
            CLI_write ("Error: BPM Configuration is valid only if the DFE Output Mode is frame or advanced frame\n");
            return -1;
        }
    
        /* Initialize the chirp configuration: */
        memset ((void *)&bpmChirpCfg, 0, sizeof(rlBpmChirpCfg_t));
    
        /* Populate the chirp configuration: */
        bpmChirpCfg.chirpStartIdx   = atoi (argv[1]);
        bpmChirpCfg.chirpEndIdx     = atoi (argv[2]);
        bpmChirpCfg.constBpmVal     = atoi (argv[3]);
       
        /* Add the BPM chirp configuration to the list */
        if (MMWave_addBpmChirp (gCLI.cfg.mmWaveHandle, &bpmChirpCfg, &errCode) == NULL)
        {
            /* Error: Unable to add the BPM configuration. Return the error code. */
            return errCode;
        }
    
        return 0;
    
    }

    mss_main.c

    /**
     *  @b Description
     *  @n
     *    Function that configures the BPM chirps based on the stored BPM CLI commands.
     *    The MMW demo supports only a fixed BPM scheme and this scheme is implemented
     *    by this function.
     *
     *  @retval
     *      0  - Success.
     *      <0 - Failed with errors
     */
    int32_t MmwDemo_bpmConfig(void)
    {
        uint8_t                subframe;
        uint8_t                numberOfSubframes = 1;
        int32_t                errCode;
        rlBpmChirpCfg_t        bpmChirpCfg;
        MMWave_BpmChirpHandle  bpmChirpHandle;
        
        if(gMmwMssMCB.cfg.ctrlCfg.dfeDataOutputMode == MMWave_DFEDataOutputMode_ADVANCED_FRAME)
        {
            /* BPM configuration for all valid subframes */
            numberOfSubframes = gMmwMssMCB.cfg.ctrlCfg.u.advancedFrameCfg.frameCfg.frameSeq.numOfSubFrames;
        }
    
        for(subframe = 0; subframe < numberOfSubframes; subframe++)
        {
            /* Is BPM enabled*/
            if(gMmwMssMCB.cliCfg[subframe].bpmCfg.isEnabled)
            {
                /*configure chirp 0 (++)*/
                memset ((void *)&bpmChirpCfg, 0, sizeof(rlBpmChirpCfg_t));
                bpmChirpCfg.chirpStartIdx = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp0Idx; 
                bpmChirpCfg.chirpEndIdx   = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp0Idx; 
                /* Phase configuration: TX0 positive, TX1 positive*/
                bpmChirpCfg.constBpmVal = 0U;
                            
                bpmChirpHandle = MMWave_addBpmChirp (gMmwMssMCB.ctrlHandle, &bpmChirpCfg, &errCode);
                if (bpmChirpHandle == NULL)
                {
                    System_printf ("Error: Unable to add BPM cfg chirp 0. Subframe %d [Error code %d]\n",subframe, errCode);
                    return -1;
                }
    
                /*configure chirp 1 (++)*/
                memset ((void *)&bpmChirpCfg, 0, sizeof(rlBpmChirpCfg_t));
                bpmChirpCfg.chirpStartIdx = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp1Idx; 
                bpmChirpCfg.chirpEndIdx   = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp1Idx; 
                /* Phase configuration: TX0 positive, TX1 negative*/
                bpmChirpCfg.constBpmVal = 0xCU;
                
                bpmChirpHandle = MMWave_addBpmChirp (gMmwMssMCB.ctrlHandle, &bpmChirpCfg, &errCode);
                if (bpmChirpHandle == NULL)
                {
                    System_printf ("Error: Unable to add BPM cfg chirp 1. Subframe %d [Error code %d]\n",subframe, errCode);
                    return -1;
                }
            }
            else
            {
                /*BPM is disabled.
                  Configure the range of chirps [chirp0Idx..chirp1Idx]
                  all to have zero phase.*/
                memset ((void *)&bpmChirpCfg, 0, sizeof(rlBpmChirpCfg_t));
                bpmChirpCfg.chirpStartIdx = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp0Idx; 
                bpmChirpCfg.chirpEndIdx   = gMmwMssMCB.cliCfg[subframe].bpmCfg.chirp1Idx; 
                /* Phase configuration: TX0 positive, TX1 positive*/
                bpmChirpCfg.constBpmVal = 0U;
                
                bpmChirpHandle = MMWave_addBpmChirp (gMmwMssMCB.ctrlHandle, &bpmChirpCfg, &errCode);
                if (bpmChirpHandle == NULL)
                {
                    System_printf ("Error: Unable to add BPM cfg for BPM disabled. Subframe %d [Error code %d]\n",subframe, errCode);
                    return -1;
                }
            }    
        }
        
        return 0;
    }
    

  • which version of SDK are you using?

    thank you

    Cesar

  • Cesar,

    mmwave_sdk_02_00_00_04

    Thanks

  • Also, where are structures like rlBpmChirpCfg_t and rlFrameCfg_t defined or initialized?

  • Hi Cesar, checking in on this... thanks!

  • Hi,

    Please review the CLI_task() code. This should help you understand how the commands are being processed. The commands in cli_mmwave.c are extensions.

    In the case of BPM I don't think the extended  Advanced command is being used

    thank you

    cesar