Part Number:AWR2243
您好,我在使用mmwave_dfp_02_02_03_01中的示例程序mmWaveLink_SingleChip_Example遇到一些问题:
我希望配置雷达为3发4收TMD-MIMO雷达,因此我配置了3个chirp,然后配置帧使用这3个chirp,相关配置如下:
#Chirp Configuration parameters, please modify if needed. #rlChirpCfg_t # chirpStartIdx=0; chirpEndIdx=0; profileIdCPCFG=0; startFreqVar=0; freqSlopeVar=0; idleTimeVar=0; adcStartTimeVar=0; txEnable=1; #END # #Chirp Configuration parameters, please modify if needed. #rlChirpCfg_t # chirpStartIdx=1; chirpEndIdx=1; profileIdCPCFG=0; startFreqVar=0; freqSlopeVar=0; idleTimeVar=0; adcStartTimeVar=0; txEnable=2; #END # #Chirp Configuration parameters, please modify if needed. #rlChirpCfg_t # chirpStartIdx=2; chirpEndIdx=2; profileIdCPCFG=0; startFreqVar=0; freqSlopeVar=0; idleTimeVar=0; adcStartTimeVar=0; txEnable=4; #END # #Frame configuration parameters, please modify if needed. #rlFrameCfg_t # chirpStartIdxFCF=0; chirpEndIdxFCF=2; frameCount=320; loopCount=64; periodicity=20000000; triggerDelay=0; numAdcSamples=512; triggerSelect=1; #END
但是运行mmwavelinxk_example.exe出现如下错误:
(1)
(2)
第一处错误,并没有导致程序终止,但是在mmwaveconfig.txt中我明明配置了3个chirp,这里只执行了两次 rlSetChirpConfig?
第二处错误导致程序终止,请问我应该怎么修改配置文件解决这两个错误?
另外请问有3发4收的雷达示例配置可以参考么,dfp中的示例程序似乎都是2发4收的?
Chris Meng:
shen huo 说:第一处错误,并没有导致程序终止
请根据错误信息,在代码debug一下错误原因。
shen huo 说:但是在mmwaveconfig.txt中我明明配置了3个chirp,这里只执行了两次 rlSetChirpConfig?
请在代码中添加打印看看为什么只调用了两次。
,
shen huo:
您好,问题已经解决
通过阅读代码,我发现确实是代码中存在bug,示例中写的代码只支持2TX
int MMWL_chirpConfig(unsigned char deviceMap) {int i, retVal = RL_RET_CODE_OK;rlChirpCfg_t setChirpCfgArgs[2] = { 0 };rlChirpCfg_t getChirpCfgArgs[MAX_GET_CHIRP_CONFIG_IDX+1] = {0};/*read chirpCfgArgs from config file*/MMWL_readChirpConfig(&setChirpCfgArgs[0], 2);printf("Calling rlSetChirpConfig with \nProfileId[%d]\nStart Idx[%d]\nEnd Idx[%d] \n\n",setChirpCfgArgs[0].profileId, setChirpCfgArgs[0].chirpStartIdx,setChirpCfgArgs[0].chirpEndIdx);printf("Calling rlSetChirpConfig with \nProfileId[%d]\nStart Idx[%d]\nEnd Idx[%d] \n\n",setChirpCfgArgs[1].profileId, setChirpCfgArgs[1].chirpStartIdx,setChirpCfgArgs[1].chirpEndIdx);/* With this API we can configure max 512 chirp in one call */retVal = rlSetChirpConfig(deviceMap, 2U, &setChirpCfgArgs[0U]);/* read back Chirp config, to verify that setChirpConfig actually set to Device@Note - This examples read back (10+1) num of chirp config for demonstration,which user can raise to match with their requirement */retVal = rlGetChirpConfig(deviceMap, setChirpCfgArgs[0].chirpStartIdx,setChirpCfgArgs[0].chirpStartIdx + MAX_GET_CHIRP_CONFIG_IDX, &getChirpCfgArgs[0]);if (retVal != RL_RET_CODE_OK){printf("GetChirp Configuration failed for deviceMap %u with error %d \n\n",deviceMap, retVal);}else{for (i=0; i <= MAX_GET_CHIRP_CONFIG_IDX; i++){/* @Note- This check assumes that all chirp configs are configured by single setChirpCfgArgs[0] *//* compare each chirpConfig parameters to lastly configured via rlDynChirpConfig API*/if ((getChirpCfgArgs[i].profileId != setChirpCfgArgs[0].profileId) || \(getChirpCfgArgs[i].freqSlopeVar != setChirpCfgArgs[0].freqSlopeVar) || \(getChirpCfgArgs[i].txEnable != setChirpCfgArgs[0].txEnable) || \(getChirpCfgArgs[i].startFreqVar != setChirpCfgArgs[0].startFreqVar) || \(getChirpCfgArgs[i].idleTimeVar != setChirpCfgArgs[0].idleTimeVar) || \(getChirpCfgArgs[i].adcStartTimeVar != setChirpCfgArgs[0].adcStartTimeVar)){printf("*** Failed - Parameters are mismatched GetChirpConfig compare to rlSetChirpConfig *** \n\n");break;}}if (i > MAX_GET_CHIRP_CONFIG_IDX){printf("Get chirp configurations are matching with parameters configured during rlSetChirpConfig \n\n");}}return retVal; }修改代码中第四行为
rlChirpCfg_t setChirpCfgArgs[3] = { 0 };
第20行为:
retVal = rlSetChirpConfig(deviceMap, 3U, &setChirpCfgArgs[0U]);
代码已经可以正常运行,