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.

AWR1642BOOST: Getting started with software modifications

Part Number: AWR1642BOOST
Other Parts Discussed in Thread: MMWAVE-SDK

Goal: To take the mmwave demo software and start modifying it to function for my purposes.

I have CCS and downloaded the SDK demo lab 1.6.2 and followed the readmes to build and flash my device. I have verified its functionality with the web visualizer. I am now at a point where I would like to start tweaking software, but am a bit lost on where to start. The project is only a couple *.c files of multiple thousand lines each and I can't find documentation that further explains the demo software structure.

I suppose I am hoping there is some recommended way to start breaking down and understanding the actual software to get the mmwave running some basic functionality. Or will I need to dig through these large *.c files in this project and just crossreference to the doxygens and start mapping it out myself?

  • Hello Eric,

    The MMWAVE-SDK provides you with the detailed documentation about the demo software and the drivers.

    You can download the MMWAVE-SDK and refer to the documentation in "$MMWAVE-SDK-INSTALL\packages\ti\demo\xwr16xx\mmw\docs\doxygen\html\index.html".

    Please let us know if this helps in your understanding.

    Thanks,
    Raghu
  • I suppose I was looking for a project that was made more modular for the sake of customer development. I have dug around the SDK and found decentralized doxygen APIs, a user guide that discusses typical layout, and a demo project. Is there any other key piece to this that I have overlooked?

    At this time I am still daunted by this task. I think you can recognize the intimidating task that is just understanding the SDK demo project which has a main.c that is 2500+ lines of ~38 functions. I just want to make sure I'm following the expected process so that I am not digging through the wrong things.

    Thanks
  • Hello Eric,

    Can you please let us know what are the kind of modifications you would like to do on the demo code? Eg: Send the object data over CAN interface instead of the UART interface etc.

    If you can give us more information on the kind of modifications you need , we can give you the pointer on the file that you will need to focus for your modification.

    Thanks,
    Raghu
  • Here are the order of events I have noted to get to the demo I need.

    1. Test build scripts to ensure they work.

    I ran the demo before holiday break and don't remember if I had the build tools working or just used the provided binaries.

    2. I will need to update configs for the actual radar parameters.

    Chirp parameters, frame parameters, and datapath.

    Not sure how to "hardcode" values.

    3. Send object data over uart and receive commands to start and stop the radar.

    The object data may need to have associated tracking and certainty information depending on susceptibility to noise in our environment.

    Interrupt driven with a task system to check on message sends and receives.

    4. Eventually have CAN sending object data and receiving commands.

    Same as before, but hoping to generate this from a can database rather than by hand.

    Thanks,

    Eric

  • In addition to #1 above, I have been looking into building and flashing the software. The SDK user guide says,

    "For the SDK packaged xWR16xx demos and ccsdebug utility, there is a bin file provided in their respective folder:
    xwr16xx_<demo|ccsdebug>.bin which is the metaImage to be used for flashing. The metaImage already has the MSS, BSS
    (RADARSS) and DSS application combined into one file."

    I am able to flash it with the indicated file, but it doesn't tell me how to flash using separate MSS/BSS files or if I need to always combine. I tried following the build steps in the guide which I can't get to work with batch files. The environment variables don't seem to apply to windows and as such it doesn't know the paths to look at, however, it does work when I execute from inside CCS. In this case, the build is successful, but it creates a separate binary for each project MSS and BSS. I am unsure what to do with these.

    Regards,
  • Hello Eric,

    Test build scripts to ensure they work.

    A1:  When you install the SDK, all the dependent tools will be installed if you have selected them during the installation.  Once installed you can build the code by setting the environment variable using setenv.bat($mmwave_sdk_01_01_00_02\packages\scripts\windows\setenv.bat).

    After setting the build environment, you can just go to demo folder and build the demo you would like to test.

    A2: The demo relies CLI to receive the radar config parameters . You can  "bypass this CLI" and hardcode the configuration by adding the below code  in the $mmwave_sdk_01_01_00_02\packages\ti\utils\cli\src\cli.c (have just taken an sample configuration you can use your own)

    #define CLI_BYPASS 1

    #define MAX_RADAR_CMD               22

    uint8_t* radarCmdString[MAX_RADAR_CMD] =

    {

    {"sensorStop \n\r"},

    {"flushCfg \n\r"},

    {"dfeDataOutputMode 1 \n\r"},

    {"channelCfg 15 3 0 \n\r"},

    {"adcCfg 2 1 \n\r"},

    {"adcbufCfg -1 0 0 1 0 \n\r"},

    {"profileCfg 0 77 287 7 200 0 0 20 1 384 2000 0 0 30 \n\r"},

    {"chirpCfg 0 0 0 0 0 0 0 1 \n\r"},

    {"chirpCfg 1 1 0 0 0 0 0 2 \n\r"},

    {"frameCfg 0 1 16 0 150 1 0 \n\r"},

    {"lowPower 0 0 \n\r"},

    {"guiMonitor -1 1 1 1 0 0 1 \n\r"},

    {"cfarCfg -1 0 0 8 4 4 0 5120 \n\r"},

    {"cfarCfg -1 1 0 4 2 3 0 5120 \n\r"},

    {"peakGrouping  -1 1 1 1 1 511 \n\r"},

    {"multiObjBeamForming -1 0 0.5 \n\r"},

    {"clutterRemoval -1 0 \n\r"},

    {"calibDcRangeSig -1 0 -5 8 256 \n\r"},

    {"extendedMaxVelocity -1 0 \n\r"},

    {"compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \n\r"},

    {"measureRangeBiasAndRxChanPhase 0 1.5 0.2 \n\r"},

    {"sensorStart \n\r"},

    };

    static int32_t CLI_ByPassApi(CLI_Cfg* ptrCLICfg)
    {
    //uint8_t cmdString[128];
    char* tokenizedArgs[CLI_MAX_ARGS];
    char* ptrCLICommand;
    char delimitter[] = " \r\n";
    uint32_t argIndex;
    CLI_CmdTableEntry* ptrCLICommandEntry;
    int32_t cliStatus;
    uint32_t index, idx;
    uint16_t numCLICommands = 0U;

    /* Sanity Check: Validate the arguments */
    if (ptrCLICfg == NULL)
    return -1;

    /* Cycle through and determine the number of supported CLI commands: */
    for (index = 0; index < CLI_MAX_CMD; index++)
    {
    /* Do we have a valid entry? */
    if (ptrCLICfg->tableEntry[index].cmd == NULL)
    {
    /* NO: This is the last entry */
    break;
    }
    else
    {
    /* YES: Increment the number of CLI commands */
    numCLICommands = numCLICommands + 1;
    }
    }

    /* Execute All Radar Commands */
    for (idx = 0; idx < MAX_RADAR_CMD; idx++)
    {
    /* Reset all the tokenized arguments: */
    memset ((void *)&tokenizedArgs, 0, sizeof(tokenizedArgs));
    argIndex = 0;
    ptrCLICommand = (char*)radarCmdString[idx];

    /* Set the CLI status: */
    cliStatus = -1;

    /* The command has been entered we now tokenize the command message */
    while (1)
    {
    /* Tokenize the arguments: */
    tokenizedArgs[argIndex] = strtok(ptrCLICommand, delimitter);
    if (tokenizedArgs[argIndex] == NULL)
    break;

    /* Increment the argument index: */
    argIndex++;
    if (argIndex >= CLI_MAX_ARGS)
    break;

    /* Reset the command string */
    ptrCLICommand = NULL;
    }

    /* Were we able to tokenize the CLI command? */
    if (argIndex == 0)
    continue;

    /* Cycle through all the registered CLI commands: */
    for (index = 0; index < numCLICommands; index++)
    {
    ptrCLICommandEntry = &ptrCLICfg->tableEntry[index];

    /* Do we have a match? */
    if (strcmp(ptrCLICommandEntry->cmd, tokenizedArgs[0]) == 0)
    {
    /* YES: Pass this to the CLI registered function */
    cliStatus = ptrCLICommandEntry->cmdHandlerFxn (argIndex, tokenizedArgs);
    if (cliStatus == 0)
    {
    CLI_write ("Done\n");
    }
    else
    {
    CLI_write ("Error %d\n", cliStatus);
    }
    break;
    }
    }

    /* Did we get a matching CLI command? */
    if (index == numCLICommands)
    {
    /* NO matching command found. Is the mmWave extension enabled? */
    if (ptrCLICfg->enableMMWaveExtension == 1U)
    {
    /* Yes: Pass this to the mmWave extension handler */
    cliStatus = CLI_MMWaveExtensionHandler (argIndex, tokenizedArgs);
    }

    /* Was the CLI command found? */
    if (cliStatus == -1)
    {
    /* No: The command was still not found */
    CLI_write ("'%s' is not recognized as a CLI command\n", tokenizedArgs[0]);
    }
    }
    }

    return 0;
    }

    You can call API "CLI_ByPassApi" in the "CLI_task" instead of existing implementation.

    A3 : The existing mmw demo in the MMWAVE-SDK receives the commands over UART and sends the object data over the UART. No modifications would be required here. 

     

    A4: You can refer to the CAN/CAN-FD driver in the MMWAVE-SDK and include the intiialization code , transmit and receive code(refer to mcanTransmitTest in $mmwave_sdk_01_01_00_02\packages\ti\drivers\canfd\test\xwr16xx\main.c) to the mmw demo code  and have the object data transmitted over CAN interface.

     

    Let me know if you need further information.

    Thanks,

    Raghu

  • Hello Eric,

    When you have to flash the image, it has to be a meta image with RadarSS, DSS, MSS image combined into one single file.
    Try to reinstall your MMWAVE-SDK , as the dependent tools are installed by the MMWAVE-SDK installer and path are setup accordingly. You do not need to follow any extra steps to add path etc.

    -Raghu
  • A1:

    I reinstalled the SDK and reran the setenv file. I still get the same results when trying to build the projects through batch files calling the make. Anytime the makefile uses a path reference $(MMWAVE_SDK_INSTALL_PATH) it does't get interpreted.

    "makefile:13: /ti/common/mmwave_sdk.mak: No such file or directory" You can see here the path reference doesn't even show up.

    I will look into your answer for A2.

    A3:

    Is there a spec of the object detection uart protocol so that I can program a receiving end on another micro?

    A4:

    Do you have any tools to convert a can database to a set of driver software or is it all manual programming?

     

    Thanks,

    Eric

  • Hello Eric,
    A1: Please post the error log to see the issue you are having with build environment.

    A3:
    The SDK has a detailed documentation for the mmw demo project in "$mmwave_sdk_01_01_00_02\packages\ti\demo\xwr16xx\mmw\docs\doxygen\html\index.html". This lists out the protocol for the object data sent over the UART. UART is the primary interface used for sending the object data out of the device.

    A4: This would be manual programming.

    -Raghu
  • sentenv.bat in C:\ti\mmwave_sdk_01_01_00_02\packages\scripts\windows

    @REM ###############################################################################
    @REM #
    @REM # Set up tools and build environment variables for mmwave sdk
    @REM #
    @REM ###############################################################################
    
    @REM ###############################################################################
    @REM # Build variables (to be modified based on build need)
    @REM ###############################################################################
    
    @REM Select your device. Options (case sensitive) are: awr14xx, iwr14xx, awr16xx, iwr16xx
    set MMWAVE_SDK_DEVICE=awr16xx
    
    @REM If download via CCS is needed, set below define to yes else no
    @REM   yes: Out file created can be loaded using CCS.
    @REM        Binary file created can be used to flash
    @REM   no:  Out file created cannot be loaded using CCS.
    @REM        Binary file created can be used to flash 
    @REM        (additional features: write-protect of TCMA, etc)
    set DOWNLOAD_FROM_CCS=yes
    
    @REM ###############################################################################
    @REM # Customer installed tools variables (to be modified based on the installation)
    @REM ###############################################################################
    
    
    @REM ###############################################################################
    @REM # TI tools variables (no changes needed below this line if default mmwave sdk
    @REM # installation options are used)
    @REM ###############################################################################
     
    set MMWAVE_SDK_TOOLS_INSTALL_PATH=C:/ti
     
    @REM Common settings for awr14xx, awr16xx, iwr14xx, iwr16xx
    @REM Path to <mmwave_sdk installation path>/packages folder
    set MMWAVE_SDK_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/mmwave_sdk_01_01_00_02/packages
    @REM TI ARM compiler
    set R4F_CODEGEN_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/ti-cgt-arm_16.9.1.LTS
    @REM TI XDC TOOLS
    set XDC_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/xdctools_3_50_00_10_core
    @REM TI BIOS
    set BIOS_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/bios_6_52_00_12/packages
      
    @REM Following only needed for awr16xx and iwr16xx
    @REM TI DSP compiler
    set C674_CODEGEN_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/ti-cgt-c6000_8.1.3
    @REM DSPlib
    set C64Px_DSPLIB_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/dsplib_c64Px_3_4_0_0
    @REM DSPlib C674
    set C674x_DSPLIB_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/dsplib_c674x_3_4_0_0
    @REM MATHlib
    set C674x_MATHLIB_INSTALL_PATH=%MMWAVE_SDK_TOOLS_INSTALL_PATH%/mathlib_c674x_3_1_2_1
    @REM awr16xx/iwr16xx radarss firmware. Use the RPRC formatted binary file.
    set XWR16XX_RADARSS_IMAGE_BIN=%MMWAVE_SDK_INSTALL_PATH%/../firmware/radarss/xwr16xx_radarss_rprc.bin
    
    @REM Call script to check env variables and set paths
    call checkenv.bat
    
    @REM Check error code
    IF %ERRORLEVEL% NEQ 0 (
      REM ERROR: Failure in checkenv.bat !!!
      REM Return error
      EXIT /B 1
    )
    
    EXIT /B 0
    
    

    make.bat in C:\ti\mmwave_sdk_01_01_00_02\packages\ti\demo\xwr16xx\mmw

    cd %MMWAVE_SDK_INSTALL_PATH%/ti/demo/xwr16xx/mmw
    gmake clean
    gmake all
    pause

  • I'm in a similar spot, getting started with development on this board. In addition to the doxygen, you might find the mmWave SDK User Guide helpful. In particular, section 5, "MMWAVE SDK deep dive" has some good info on how things are done on this platform and what drivers are available. You can find this guide in ti\mmwave_sdk_01_01_00_02\docs\mmwave_sdk_user_guide.pdf.
  • Hello Eric,
    Do you get the same error if you try without using your make.bat for the build ?

    -Raghu
  • Raghunandan,

    Can you elaborate on trying to build without the bat? Do you mean via manual command prompt or through CCS? I can tell you that through CCS works.

    Thanks,

  • Hello Eric,

    It looks like you are not executing the make.bat in the same command window you used for setenv.bat. Please confirm where you execute make.bat. 

    I meant via manual command prompt in the same command window where you set the environment variables. 


    -Raghu

  • Ahh yes, that was the issue. I didn't realize the PATHs were local to the command prompt and the verbage made me think two bats was ok.

    I think every one of my questions has been answered. I haven't gone through the entire process, but I'll mark one of the replies as 'answer'.

    Thanks!