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: verification of new LUA script equivalent to reference CLI command

Part Number: IWR6843ISK-ODS
Other Parts Discussed in Thread: MMWAVEICBOOST,

Dear support team,

I would like to create new LUA script equivalent to below reference CLI command regarding chirp and frame configuration.

I am fine if you correct my script.

[reference CLI command]

 "channelCfg 15 7 0 ",

 "adcCfg 2 1 ",

 "adcbufCfg -1 0 0 1 0",

 "profileCfg 0 60.50002 71  6 34 0 0 102.908 0 64 2350 0 0 30 ",

 "profileCfg 1 60.50002 82  6 34 0 0 102.908 0 64 2350 0 0 30 ",

 "chirpCfg 0 0 0 0 0 0 0 4 ",

 "chirpCfg 1 1 0 0 0 0 0 2 ",

 "frameCfg 0 1 128 0 33 1 0 ",

[new LUA script]

[20:40:20]  [RadarAPI]: ar1.ProfileConfig(0, 60.5, 71, 6, 34, 0, 0, 0, 0, 0, 0, 102.908, 0, 64, 2350, 0, 131072, 30)

[20:45:28]  [RadarAPI]: ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)

[20:45:34]  [RadarAPI]: ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0)

[20:50:12]  [RadarAPI]: ar1.FrameConfig(0, 1, 600, 128, 33, 0, 0, 1)

Best regards,

Taka

  • Hello

    Are you trying to use the LUA script on the DCA1000 + MMWave Stduio platform?

    Wonder if you have looked at any of the lua scripts provided as part of the studio example?

    Thank you,

    Vaidbhav

  • Hello Vaibhav,

    Yes, I am using IWR6843ISK-ODS + MMWAVEICBOOST + DCA1000 + MMWave Studio Demo.

    Here you have my LUA script. Please kindly confirm if this code is equivalent to CLI command.

    elseif(partId == 6843) then
         if(ar1.ProfileConfig(0, 60.5, 71, 6, 34, 0, 0, 0, 0, 0, 0, 102.908, 0, 64, 2350, 0, 131072, 30) == 0) then
      WriteToLog("ProfileConfig Success\n", "green")
        else
            WriteToLog("ProfileConfig failure\n", "red")
        end
    end


    if (ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0) == 0) then
        WriteToLog("ChirpConfig Success\n", "green")
    else
        WriteToLog("ChirpConfig failure\n", "red")
    end

    if (ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0) == 0) then
        WriteToLog("ChirpConfig Success\n", "green")
    else
        WriteToLog("ChirpConfig failure\n", "red")
    end

    if (ar1.EnableTestSource(1) == 0) then
        WriteToLog("Enabling Test Source Success\n", "green")
    else
        WriteToLog("Enabling Test Source failure\n", "red")
    end


    if (ar1.FrameConfig(0, 1, 300, 128, 33, 0, 0, 1) == 0) then
        WriteToLog("FrameConfig Success\n", "green")
    else
        WriteToLog("FrameConfig failure\n", "red")
    end

    Also, let me attach whole LUA script. But range-velocity heat map in PostProcessing is totally blue with this script. (It means nothing is detected.)

    I am afraid there is missing command in this script to capture raw data. I am fine if you can advise to resolve this issue.

    Best regards,

    Taka

    ----------------------------------------------------

    Hello Vaibhav,

    I am trying to attach LUA script file but it is always failed. May I ask to let me know how to attach here ?

    Best regards, Taka

  • Hi, Taka:

    We do not have a tool to convert between the two format.  But you can do following

    1) Understand the SDK CLI command format by searching the command in the SDK users guide.

    2) Understand the radar studio LUA command by typing e.g. "help ar1.FrameConfig" in LUA shell.

    Then you can confirm whether the two command are the same. 

    Best,

    Zigang

  • Hello Zigang,

    I am very much disapointed with your reply. If there is no translation tool between CLI and LUA, who can advise instead of you ?

    What is most unclear is ar1.chirpconfig. In case of CLI command, two commands are issued.

    How about LUA script ? Also should two commands be issued ?

     "chirpCfg 0 0 0 0 0 0 0 4 ",

     "chirpCfg 1 1 0 0 0 0 0 2 ",

    ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)

    ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0)

    Best regards,

    Taka

  • HI, Taka:

    I am not aware of any conversion tool but there are documentations that can help you to figure them out. 

    Below is an example to show you how to use the documentation to understand the format and figure out whether they are matching or not.

    Here is the lua shell display: 

    >help ar1.ChirpConfig
    Int32 ar1.ChirpConfig(UInt16 chirpStartIdx, UInt16 chirpEndIdx, UInt16 profileId, Single startFreqVar, Single freqSlopeVar, Single idleTimeVar, Single adcStartTimeVar, UInt16 tx0Enable, UInt16 tx1Enable, UInt16 tx2Enable) - Chirp configuration API which defines which profile is to be used for each chirp in a frame
    _I_ UInt16 chirpStartIdx - First Chirp Start Index number
    _I_ UInt16 chirpEndIdx - Last chirp Index number
    _I_ UInt16 profileId - Chirp Configured profileId
    _I_ Single startFreqVar - Chirp start frequency var in MHz
    _I_ Single freqSlopeVar - frequency Slope Var in MHz/µs
    _I_ Single idleTimeVar - Idle Time Var in µs
    _I_ Single adcStartTimeVar - ADC Start Time Var in µs
    _I_ UInt16 tx0Enable - tx0 channel
    _I_ UInt16 tx1Enable - tx1 channel
    _I_ UInt16 tx2Enable - tx2 channel

    So, you get to know that by sending

    ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)

    ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0)

    you are actually enable TX0 in chirp 0 and enable TX1 in chirp 1 in your LUA script.

    In the SDK users guide located at C:\ti\mmwave_sdk_03_05_00_04\docs\mmwave_sdk_user_guide.pdf,  you can find that the last field for chirpCfg is defined as below: 

    tx antenna enable mask (Tx2,Tx1) e.g (10)b = Tx2 enabled, Tx1 disabled.

    I.e., the higher bit is for higher TX antenna ID.  So "4" is actually means enable TX2, "2" means enable TX1 and "1" means enable TX0. 

    By sending 

     "chirpCfg 0 0 0 0 0 0 0 4 ",

     "chirpCfg 1 1 0 0 0 0 0 2 ",

    You are actually enable TX2 in chirp 0 and enable TX1 in chirp1. 

    So you have a mismatch between LUA script and SDK CLI command in teams of chirpCfg. 

    Best,

    Zigang

  • Dear Zigang,

    Thank you for your kind explanation. I believe below command should be issued. 

    ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 0, 0, 1)

    ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0)

    Best regards,

    Taka