请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TIDA-020047 工具与软件:
您好!
最近、在调试高级帧模式时、遇到此界面时会遇到一些问题:
我的 SDK:04.04.01.02
在 界面"mmwave_configureAdvFrame"中: 该变量的 值可以为0或1。 pstAdvFrameCfg = &ptrControlCfg->u.advancedFrameCfg[u32DevIdx].frameCfg;u32DevIdx
static int32_t MMWave_configureAdvFrame(MMWave_MCB * ptrMMWaveMCB, MMWave_CtrlCfg * ptrControlCfg, int32_t * errCode)
{
MMWave_ProfileHandle * ptrProfileHandle;
rlAdvFrameCfg_t * pstAdvFrameCfg;
rlProfileCfg_t stProfileCfg;
int32_t retVal;
uint32_t u32ProfIdx;
uint32_t u32SubFrIdx;
uint32_t u32DevIdx;
uint16_t u16MasterTriggerSelectCnf;
uint16_t u16AdcDataType;
uint16_t u16NumAdcSamples;
uint8_t u8DeviceMap;
/* Get data to compute the value of the numAdcSamples parameter.
* NOTE: It is assumed that all devices use the same number of ADC samples. */
if(ptrMMWaveMCB->openCfg.adcOutCfg.fmt.b2AdcOutFmt == 0U)
{
u16AdcDataType = 1U; /* Data type = Real */
}
else
{
u16AdcDataType = 2U; /* Data type = Complex */
}
/* Get the number of ADC samples (it is expected that all profiles across
* all devices have the same number) */
ptrProfileHandle = &ptrControlCfg->u.advancedFrameCfg[ptrMMWaveMCB->openCfg.MasterDevIdx].profileHandle[0];
for(u32ProfIdx = 0U; u32ProfIdx < MMWAVE_MAX_PROFILE; u32ProfIdx++)
{
/* Check if this index holds a profile handle */
if(ptrProfileHandle[u32ProfIdx] != NULL)
{
/* Get the profile configuration */
MMWave_getProfileCfg(ptrProfileHandle[u32ProfIdx], &stProfileCfg, errCode);
/* Compute the number of ADC samples for the frame configuration */
u16NumAdcSamples = u16AdcDataType * stProfileCfg.numAdcSamples;
break;
}
}
/* Loop across all devices to check the trigger select configuration */
for(u32DevIdx = 0U; u32DevIdx < MMWAVE_RADAR_DEVICES; u32DevIdx++)
{
/* Get the frame configuration of the device */
pstAdvFrameCfg = &ptrControlCfg->u.advancedFrameCfg[u32DevIdx].frameCfg;
if(u32DevIdx == (uint32_t) ptrMMWaveMCB->openCfg.MasterDevIdx)
{
/* Master - Frame can be triggered by external trigger or by SW) */
if(pstAdvFrameCfg->frameSeq.triggerSelect != (uint16_t) RL_FRAMESTRT_SYNCIN_TRIGGER)
{
pstAdvFrameCfg->frameSeq.triggerSelect = (uint16_t) RL_FRAMESTRT_API_TRIGGER;
}
u16MasterTriggerSelectCnf = pstAdvFrameCfg->frameSeq.triggerSelect;
}
else
{
/* Slaves - Frame can be triggered only by external trigger */
pstAdvFrameCfg->frameSeq.triggerSelect = (uint16_t) RL_FRAMESTRT_SYNCIN_TRIGGER;
}
}
/* Loop across all devices to
* - check the sub-frame trigger configuration.
* - update the number of ADC sample for each sub-frame */
for(u32DevIdx = 0U; u32DevIdx < MMWAVE_RADAR_DEVICES; u32DevIdx++)
{
/* Get the frame configuration of the device */
pstAdvFrameCfg = &ptrControlCfg->u.advancedFrameCfg[u32DevIdx].frameCfg;
/* NOTE: The configuration HW or SW trigger for frames and no trigger for sub-frames */
if(u16MasterTriggerSelectCnf == (uint16_t) RL_FRAMESTRT_API_TRIGGER)
{
/* Master is triggered by SW, then no need of sub-frame trigger */
pstAdvFrameCfg->frameSeq.subFrameTrigger = 0U;
}
else
{
/* Master is triggered by HW, then sub-frames should also be triggered by HW. */
pstAdvFrameCfg->frameSeq.subFrameTrigger = 1U;
}
/* Update the number of ADC sample with the computed value. This parameter is
* required only for AWR1243/2243 chips and configures the size of ADC samples
* per chirp to be sent on LVDS/CSI2 interface */
for(u32SubFrIdx = 0U; u32SubFrIdx < (uint32_t) pstAdvFrameCfg->frameData.numSubFrames; u32SubFrIdx++)
{
pstAdvFrameCfg->frameData.subframeDataCfg[u32SubFrIdx].numAdcSamples = u16NumAdcSamples;
}
}
/* Loop across all devices to send the advanced frame configuration */
u32DevIdx = 0;
for(u32DevIdx = 0U; u32DevIdx < MMWAVE_RADAR_DEVICES; u32DevIdx++)
{
/* Create a local device map to select each device one per one */
u8DeviceMap = (uint8_t) ((uint32_t) 1U << u32DevIdx);
/* Get the frame configuration of the device */
pstAdvFrameCfg = &ptrControlCfg->u.advancedFrameCfg[u32DevIdx].frameCfg;
retVal = rlSetAdvFrameConfig(u8DeviceMap, pstAdvFrameCfg);
if (retVal != RL_RET_CODE_OK)
{
*errCode = MMWave_encodeError(MMWave_ErrorLevel_ERROR, MMWAVE_EFRAMECFG, retVal);
retVal = MINUS_ONE;
break;
}
}
return retVal;
}
但是、在该 文件中、所有与高级帧相关的接口仅为 ID 为0的结构分配值。 例如、在接口的配置中 、只有 cli_mmwave.c CLI_MMWaveAdvFrameDataCfg
为 ID 为0的结构分配值、如以下代码所示:
memcpy((void *)&gCLIMMWaveControlCfg.u.advancedFrameCfg[0].frameCfg.frameData.subframeDataCfg[subFrameNum], (void *)&subFrameDataCfg, sizeof(rlSubFrameDataCfg_t));
static int32_t CLI_MMWaveAdvFrameDataCfg (int32_t argc, char* argv[])
{
rlSubFrameDataCfg_t subFrameDataCfg;
uint8_t subFrameNum;
/* Sanity Check: Minimum argument check */
if (argc != 5)
{
CLI_write ("Error: Invalid usage of the CLI command\n");
return -1;
}
/* Sanity Check: Sub Frame configuration is valid only for the Advanced Frame Mode: */
if (gCLIMMWaveControlCfg.dfeDataOutputMode != MMWave_DFEDataOutputMode_ADVANCED_FRAME)
{
CLI_write ("Error: Configuration is valid only if the DFE Output Mode is Advanced Frame\n");
return -1;
}
/* Initialize the frame configuration: */
memset ((void *)&subFrameDataCfg, 0, sizeof(rlSubFrameDataCfg_t));
/* Populate the frame configuration: */
subFrameNum = (uint8_t)atoi (argv[1]);
if (subFrameNum > gCLIMMWaveControlCfg.u.advancedFrameCfg[0].frameCfg.frameData.numSubFrames)
{
CLI_write ("Error: Invalid subframe number.\n");
return -1;
}
subFrameDataCfg.numAdcSamples = atoi (argv[2]) * 2 ;
subFrameDataCfg.totalChirps = atoi (argv[3]);
subFrameDataCfg.numChirpsInDataPacket = atoi (argv[4]);
/* Save Configuration to use later */
memcpy((void *)&gCLIMMWaveControlCfg.u.advancedFrameCfg[0].frameCfg.frameData.subframeDataCfg[subFrameNum],
(void *)&subFrameDataCfg, sizeof(rlSubFrameDataCfg_t));
return 0;
}
他应该会有问题、对吧? 应如何校正它?