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.

RTOS/AWR1642: Can I add a new parameters of CLI ?

Part Number: AWR1642

Tool/software: TI-RTOS

If I want add a new configuration in cli.c

Are there any Information which can refer to?

Regards,

Jui Yang

  • Hi,

    Please compare the CLI in mmWave SDK 1.0 and mmWave SDK 1.1

    You will see some new commands added in mmWave SDK 1.1.

    Please follow the example

    thank you
    Cesar
  •  

    These steps are for the AWR1642:

     

    1. Edit cli.c. First, go to the function MmwDemo_CLIInit() and you will see a series of code blocks that look like this:

       cliCfg.tableEntry[cnt].cmd           = "yourCfg";
       cliCfg.tableEntry[cnt].helpString     = "<parm1> <parm2> ... <parmN>”;
       cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_YourCfg;
       cnt++;

    1. Make a copy of these lines for your new command. You will need to create a new handler function named MmwDemo_YourCfg, and the command name to be added to the profile’s .cfg file will be yourCfg. Find a similar handler for the type of command you are adding and make a copy of it, giving it the name MmwDemo_YourCfg.

    2. Edit mmw_messages.h. Add two things:

      1. A new variable or structure to MmwDemo_message_body to hold your new command’s data. We will use the name your_data for this example.

      2. A new enumeration entry to MmwDemo_message_type, to the MSS -> DSS grouping.

    3. You will need to add your new enumeration to two places:

      1. MSS: In cli.c, in your new handler (MmwDemo_XxxCfg), at the bottom of the function, set message.type = your new enum name. Use argc and argv[] to copy the received data. Note that the command name counts as one, so if you have 5 arguments, argc will equal 6. Also make sure that your new handler copies the data read from argv[] into message.body.your_data before the mailbox write.

      2. DSS: In dss_main.c, add a new case entry in MmwDemo_mboxRead() for your new command. In the new case entry, use a memcpy to copy the command data from message.body.your_data to your location of choice, the easiest being a global variable or structure.

    4. After re-building your code, follow the directions in the SDK User Guide for flashing the CCS Debug image and loading the cores from the CCS debugger. You can set breakpoints in cli.c to verify that your new command is read from the profile .cfg file correctly, and in the DSS in MmwDemo_mboxRead() to verify that your data arrives in message.body.your_data, and is copied to your global correctly.