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.

AWR6843AOPEVM: 运行DataCaptureDemo_xWR.lua脚本时报错

Part Number: AWR6843AOPEVM
Other Parts Discussed in Thread: IWR6843AOP

您好,我们在运行DataCaptureDemo_xWR.lua脚本时出现如下报错,请问是什么原因呢?

[15:30:59] LuaLoad("C:/ti/mmwave_studio_02_01_01_00/mmWaveStudio/Scripts/DataCaptureDemo_xWR.lua")
[15:31:00] [RadarAPI]: Opening Board Control Port()
[15:31:00] [RadarAPI]: Status: Passed
[15:31:01] [RadarAPI]: ar1.FullReset()
[15:31:01] [RadarAPI]: Status: Passed
[15:31:01] [RadarAPI]: Closing Board Control Port()
[15:31:01] [RadarAPI]: Status: Passed
[15:31:01] [RadarAPI]: Opening Gpio Control Port()
[15:31:01] [RadarAPI]: Status: Passed
[15:31:02] [RadarAPI]: Opening Board Control Port()
[15:31:02] [RadarAPI]: Status: Passed
[15:31:03] [RadarAPI]: ar1.FullReset()
[15:31:03] [RadarAPI]: Status: Passed
[15:31:03] [RadarAPI]: Closing Board Control Port()
[15:31:03] [RadarAPI]: Status: Passed
[15:31:03] [RadarAPI]: Closing Gpio Control Port()
[15:31:03] [RadarAPI]: Status: Passed
[15:31:03] [RadarAPI]: ar1.SOPControl(2)
[15:31:03] [RadarAPI]: Status: Passed
[15:31:03] [RadarAPI]: ar1.Connect(5,115200,1000)
[15:31:04] [RadarAPI]: ar1.Calling_IsConnected()
[15:31:06] Device Status : UnDetDe/ASIL-B/SOP:2/ES:2
[15:31:06] [RadarAPI]: ar1.ReadRegister(0xffffe214, 0, 31)
[15:31:06] [RadarAPI]: ar1.ReadRegister(0xffffe210, 0, 31)
[15:31:06]
[15:31:06] &&&&&&&&&&&&&&&&&&&&
[15:31:06] ***Script FAILED!***
[15:31:06] &&&&&&&&&&&&&&&&&&&&
[15:31:06] Exception message is:
[15:31:06] ...1_01_00\mmWaveStudio\Scripts\DataCaptureDemo_xWR.lua:51: attempt to concatenate global 'partId' (a nil value)

  • 现在运行后界面如图所示,SPI的连接未成功。

    脚本应该是没有成功从寄存器中读到数据,不能得到partId的值,不知道应该如何修改了

  • DataCaptureDemo_xWR.lua脚本代码如下:

    ar1.FullReset()
    ar1.SOPControl(2)
    ar1.Connect(5,115200,1000)
    
    --BSS and MSS firmware download
    info = debug.getinfo(1,'S');
    file_path = (info.source);
    file_path = string.gsub(file_path, "@","");
    file_path = string.gsub(file_path, "DataCaptureDemo_xWR.lua","");
    fw_path   = file_path.."..\\..\\rf_eval_firmware"
    
    --Export bit operation file
    bitopfile = file_path.."\\".."bitoperations.lua"
    dofile(bitopfile)
    
    --Read part ID
    --This register address used to find part number for ES2 and ES3 devices
    res, efusedevice = ar1.ReadRegister(0xFFFFE214, 0, 31)
    res, efuseES1device = ar1.ReadRegister(0xFFFFE210, 0, 31)
    efuseES2ES3Device = bit_and(efusedevice, 0x03FC0000)
    efuseES2ES3Device = bit_rshift(efuseES2ES3Device, 18)
    
    --if part number is zero then those are ES1 devices 
    if(efuseES2ES3Device == 0) then
    	if (bit_and(efuseES1device, 3) == 0) then
    		partId = 1243
    	elseif (bit_and(efuseES1device, 3) == 1) then
    		partId = 1443
    	else
    		partId = 1642
    	end
    elseif(efuseES2ES3Device == 0xE0 and (bit_and(efuseES1device, 3) == 2)) then
    		partId = 6843
    		ar1.frequencyBandSelection("60G")
    --if part number is non-zero then those are ES12 and ES3 devices
    else
       if(efuseES2ES3Device == 0x20 or efuseES2ES3Device == 0x21 or efuseES2ES3Device == 0x80) then
    		partId = 1243
    	elseif(efuseES2ES3Device == 0xA0 or efuseES2ES3Device == 0x40)then
    		partId = 1443
    	elseif(efuseES2ES3Device == 0x60 or efuseES2ES3Device == 0x61 or efuseES2ES3Device == 0x04 or efuseES2ES3Device == 0x62 or efuseES2ES3Device == 0x67) then
    		partId = 1642
    	elseif(efuseES2ES3Device == 0x66 or efuseES2ES3Device == 0x01 or efuseES2ES3Device == 0xC0 or efuseES2ES3Device == 0xC1) then
    		partId = 1642
    	elseif(efuseES2ES3Device == 0x70 or efuseES2ES3Device == 0x71 or efuseES2ES3Device == 0xD0 or efuseES2ES3Device == 0x05) then
    		partId = 1843
    	elseif(efuseES2ES3Device == 0xE0 or efuseES2ES3Device == 0xE1 or efuseES2ES3Device == 0xE2 or efuseES2ES3Device == 0xE3 or efuseES2ES3Device == 0xE4) then
    		partId = 6843
    		ar1.frequencyBandSelection("60G")
    	else
    		WriteToLog("Inavlid Device part number in ES2 and ES3 devices\n" ..partId)
        end
    end 
    
    --ES version
    res, ESVersion = ar1.ReadRegister(0xFFFFE218, 0, 31)
    ESVersion = bit_and(ESVersion, 15)
    
    --ADC_Data file path
    --data_path     = file_path.."..\\PostProc"
    --adc_data_path = data_path.."\\adc_data.bin"
    data_path     = "D:\\RadarProcessing\\DataFile\\TestData"
    adc_data_path = "D:\\RadarProcessing\\DataFile\\TestData\\adc_data.bin"
    -- Path above mentioned can be changed according to your requirements
    
    -- Download Firmware
    if(partId == 1642) then
        BSS_FW    = fw_path.."\\radarss\\xwr16xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr16xx_masterss.bin"
    elseif(partId == 1243) then
        BSS_FW    = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
    elseif(partId == 1443) then
        BSS_FW    = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
    elseif(partId == 1843) then
        BSS_FW    = fw_path.."\\radarss\\xwr18xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr18xx_masterss.bin"
    elseif(partId == 6843) then
        BSS_FW    = fw_path.."\\radarss\\xwr68xx_radarss.bin"
        MSS_FW    = fw_path.."\\masterss\\xwr68xx_masterss.bin"
    else
        WriteToLog("Invalid Device partId FW\n" ..partId)
        WriteToLog("Invalid Device ESVersion\n" ..ESVersion)
    end
    
    -- Download BSS Firmware
    if (ar1.DownloadBSSFw(BSS_FW) == 0) then
        WriteToLog("BSS FW Download Success\n", "green")
    else
        WriteToLog("BSS FW Download failure\n", "red")
    end
    
    -- Download MSS Firmware
    if (ar1.DownloadMSSFw(MSS_FW) == 0) then
        WriteToLog("MSS FW Download Success\n", "green")
    else
        WriteToLog("MSS FW Download failure\n", "red")
    end
    
    -- SPI Connect
    if (ar1.PowerOn(1, 1000, 0, 0) == 0) then
        WriteToLog("Power On Success\n", "green")
    else
       WriteToLog("Power On failure\n", "red")
    end
    
    -- RF Power UP
    if (ar1.RfEnable() == 0) then
        WriteToLog("RF Enable Success\n", "green")
    else
        WriteToLog("RF Enable failure\n", "red")
    end
    
    if (ar1.ChanNAdcConfig(1, 1, 0, 1, 1, 1, 1, 2, 1, 0) == 0) then
        WriteToLog("ChanNAdcConfig Success\n", "green")
    else
        WriteToLog("ChanNAdcConfig failure\n", "red")
    end
    
    if (partId == 1642) then
        if (ar1.LPModConfig(0, 1) == 0) then
            WriteToLog("LPModConfig Success\n", "green")
        else
            WriteToLog("LPModConfig failure\n", "red")
        end
    else
        if (ar1.LPModConfig(0, 0) == 0) then
            WriteToLog("Regualar mode Cfg Success\n", "green")
        else
            WriteToLog("Regualar mode Cfg failure\n", "red")
        end
    end
    
    if (ar1.RfInit() == 0) then
        WriteToLog("RfInit Success\n", "green")
    else
        WriteToLog("RfInit failure\n", "red")
    end
    
    RSTD.Sleep(1000)
    
    if (ar1.DataPathConfig(1, 1, 0) == 0) then
        WriteToLog("DataPathConfig Success\n", "green")
    else
        WriteToLog("DataPathConfig failure\n", "red")
    end
    
    if (ar1.LvdsClkConfig(1, 1) == 0) then
        WriteToLog("LvdsClkConfig Success\n", "green")
    else
        WriteToLog("LvdsClkConfig failure\n", "red")
    end
    
    if((partId == 1642) or (partId == 1843) or (partId == 6843)) then
        if (ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0) == 0) then
            WriteToLog("LVDSLaneConfig Success\n", "green")
        else
            WriteToLog("LVDSLaneConfig failure\n", "red")
        end
    elseif ((partId == 1243) or (partId == 1443)) then
        if (ar1.LVDSLaneConfig(0, 1, 1, 1, 1, 1, 0, 0) == 0) then
            WriteToLog("LVDSLaneConfig Success\n", "green")
        else
            WriteToLog("LVDSLaneConfig failure\n", "red")
        end
    end
    
    if (ar1.SetTestSource(4, 3, 0, 0, 0, 0, -327, 0, -327, 327, 327, 327, -2.5, 327, 327, 0, 0, 0, 0, -327, 0, -327, 
                          327, 327, 327, -95, 0, 0, 0.5, 0, 1, 0, 1.5, 0, 0, 0, 0, 0, 0, 0) == 0) then
        WriteToLog("Test Source Configuration Success\n", "green")
    else
        WriteToLog("Test Source Configuration failure\n", "red")
    end
    
    if((partId == 1642) or (partId == 1843)) then
        if(ar1.ProfileConfig(0, 77, 100, 6, 60, 0, 0, 0, 0, 0, 0, 29.982, 0, 256, 5000, 0, 0, 30) == 0) then
            WriteToLog("ProfileConfig Success\n", "green")
        else
            WriteToLog("ProfileConfig failure\n", "red")
        end
    elseif((partId == 1243) or (partId == 1443)) then
        if(ar1.ProfileConfig(0, 77, 100, 6, 60, 0, 0, 0, 0, 0, 0, 29.982, 0, 256, 10000, 0, 0, 30) == 0) then
            WriteToLog("ProfileConfig Success\n", "green")
        else
            WriteToLog("ProfileConfig failure\n", "red")
        end
    elseif(partId == 6843) then
        if(ar1.ProfileConfig(0, 60.25, 100, 6, 60, 0, 0, 0, 0, 0, 0, 29.982, 0, 256, 10000, 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, 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, 0, 8, 128, 40, 0, 0, 1) == 0) then
        WriteToLog("FrameConfig Success\n", "green")
    else
        WriteToLog("FrameConfig failure\n", "red")
    end
    
    -- select Device type
    if (ar1.SelectCaptureDevice("DCA1000") == 0) then
        WriteToLog("SelectCaptureDevice Success\n", "green")
    else
        WriteToLog("SelectCaptureDevice failure\n", "red")
    end
    
    --DATA CAPTURE CARD API
    if (ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098) == 0) then
        WriteToLog("CaptureCardConfig_EthInit Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_EthInit failure\n", "red")
    end
    
    --AWR12xx or xWR14xx-1, xWR16xx or xWR18xx or xWR68xx- 2 (second parameter indicates the device type)
    if ((partId == 1642) or (partId == 1843) or (partId == 6843)) then
        if (ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30) == 0) then
            WriteToLog("CaptureCardConfig_Mode Success\n", "green")
        else
            WriteToLog("CaptureCardConfig_Mode failure\n", "red")
        end
    elseif ((partId == 1243) or (partId == 1443)) then
        if (ar1.CaptureCardConfig_Mode(1, 1, 1, 2, 3, 30) == 0) then
            WriteToLog("CaptureCardConfig_Mode Success\n", "green")
        else
            WriteToLog("CaptureCardConfig_Mode failure\n", "red")
        end
    end
    
    if (ar1.CaptureCardConfig_PacketDelay(25) == 0) then
        WriteToLog("CaptureCardConfig_PacketDelay Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_PacketDelay failure\n", "red")
    end
    
    --Start Record ADC data
    ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
    RSTD.Sleep(1000)
    
    --Trigger frame
    ar1.StartFrame()
    RSTD.Sleep(5000)
    
    --Post process the Capture RAW ADC data
    ar1.StartMatlabPostProc(adc_data_path)
    WriteToLog("Please wait for a few seconds for matlab post processing .....!!!! \n", "green")
    RSTD.Sleep(10000)
    

  • 请看一下Quick Start Guide里的步骤7 Issue a board reset and connect the RS232 COM port,是否在执行DataCapturedemo_xWR.lua前复位一下板子?
    https://www.ti.com/lit/ml/spruik7/spruik7.pdf

  • 您好,我在其他地方发表的帖子收到的回复,建议我查看一下我所使用的板子所烧录的固件版本是E1还是E2/E3,请问怎样查看所烧录的固件版本呢?

  • BSS FW, MSS FW是在板子连接上后下载到芯片上的,不是事先烧写好的。

  • 是的,但是固件版本是指的什么,我看在DataCapturedemo_xWR.lua文件里也有判断固件版本的语句

  • 您好,我在连接SPI的时候还遇到这样的问题,是因为没有复位板子吗?

    [15:01:50] [RadarAPI]: ar1.PowerOn(0, 1000, 0, 0)
    [15:01:50] Status: Failed, Error Type: RESP TIMEOUT
    [15:01:54] MSS Power Up async event was not received!

  • 请问一下怎样复位板子?

  • 您好,我按照您所发文档进行操作了,但是我仍然出现不能正确读出pratId的问题。

    在运行DataCapturedemo_xWR.lua脚本的这段语句中:

    我读出来的efuseES2ES3Device的值是243:

    并不能对应找出pratId

    所以一直报错为:

    请问这是什么原因,有什么解决方法吗?期待您的及时回复。

  • 请问您的AWR6843AOPEVM是REV F版本还是REV G版本?


  • 您好,我们的AWR6843AOPEVM是REV F版本

  • 您好,我已经按照您所提供的文档DCA1000EVM Quick Start Guide (ti.com)进行了操作了,还是出现同样的报错,希望您能提供一下不能找出partId的解决方法。

  • 能否发一下板子的连接图,看一下拨位开关的配置。

  • 看一下Table 4-3. SOP Configuration里的s3是否是OFF?
    https://www.ti.com/lit/ug/swru546e/swru546e.pdf


  • 您好,我想询问一下就是我如果使用lua文件脱机操作板子的话,是需要烧录xwr68xx_mmw_demo.bin的吗?因为现在我在手动通过mmwave studio进行操作的时候,是把COM port(Application/User UART)端口进行了擦除后才成功的,我发现我烧录了xwr68xx_mmw_demo.bin文件后,手动的方法就不可以用了,并且使用lua文件仍然编译不通过。脱机操作和使用mmwave studio的操作到底有什么区别,能否提供详细的说明书。

  • 您好,我在脚本中强制将partId设置为6843后,按道理就应该可以运行了,但是在运行这句话ar1.PowerOn(0, 1000, 0, 0)的时候,还是出现了问题:


    我在论坛上寻找类似的问题,发现大家都是MSS的版本号不正确,为(0,0,0,0)但是我这里应该是已经读取到了正确的版本号,为什么还是会出现错误呢?

  • 发现您的图接法有问题,还有一根USB线要接在ICBOOST板子上,不是AOPEVM板上。

  • 您好,具体的接法您能提供一下吗?我是按照这样的连接方式连接的:

    难道脱机操作和使用mmwave studio操作时的连接方式不一致?请问能否提供两种操作方式的说明书?

  • 您好,我在查看帖子的时候发现,在进行对端口的Uniflush烧录的时候,我只找得到xwr68xx_mmw_demo.bin文件,找不到xwr68xxAOP_mmw_demo.bin文件,就像下图:

    请问该文件在哪里找得到呢?另外,我们的板子型号是AWR6843AOPEVM,而视频里的板子是IWR6843AOP,这个文件是否存在差异?

  • 截图中的bin文件在C:\ti\mmwave_industrial_toolbox_4_8_0\labs\out_of_box_demo\68xx_aop_mmwave_sdk_hwa\prebuilt_binaries。

    我们的板子型号是AWR6843AOPEVM,而视频里的板子是IWR6843AOP,这个文件是否存在差异?

    这两块板子一样的。