TI中文支持网
TI专业的中文技术问题搜集分享网站

AWR1843BOOST: SDK使用低速串行总线的实时 ADC 原始数据采集方法遇到的问题

Part Number:AWR1843BOOST

我在使用https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_传感器_zhcab69.pdf, (uint8_t*)(&outdata[0]), tl[tlvIdx].length-2);给注释掉会有数据输出,所想想知道是怎样的问题呢?

void TrackerDemo_transmitProcessedOutput(UART_Handle uartHandle,DPC_ObjectDetection_ExecuteResult *result)代码如下:

void TrackerDemo_transmitProcessedOutput(UART_Handle uartHandle,DPC_ObjectDetection_ExecuteResult *result)
{uint32_t packetLen;uint32_t tlvIdx = 0;uint32_t numPaddingBytes;uint8_t padding[MMWDEMO_OUTPUT_MSG_SEGMENT_LEN];MmwDemo_output_message_tltl[MMWDEMO_OUTPUT_MSG_MAX];DPIF_PointCloudCartesian *objOut;DPIF_PointCloudSpherical *objOutSph;DPIF_PointCloudSideInfo *objOutSideInfo;DPC_ObjectDetection_Stats *stats;trackerProc_Target *tList;trackerProc_TargetIndex *tIndex;int32_t errCode;intn;uint16_t*headerPtr;uint32_tsum;TrackerDemo_output_message_header outputMessage;/* Clear message header */memset((void *)&outputMessage, 0, sizeof(TrackerDemo_output_message_header));/* Header: */outputMessage.platform =  0xA6843;outputMessage.magicWord[0] = 0x0102;outputMessage.magicWord[1] = 0x0304;outputMessage.magicWord[2] = 0x0506;outputMessage.magicWord[3] = 0x0708;outputMessage.version =MMWAVE_SDK_VERSION_BUILD |//DEBUG_VERSION(MMWAVE_SDK_VERSION_BUGFIX << 8) |(MMWAVE_SDK_VERSION_MINOR << 16) |(MMWAVE_SDK_VERSION_MAJOR << 24);/******************************************************************Send out data that is enabled, Since processing results are from DSP,address translation is needed for buffer pointers*******************************************************************/{objOut = (DPIF_PointCloudCartesian *) SOC_translateAddress((uint32_t)result->objOut,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)objOut != SOC_TRANSLATEADDR_INVALID);objOutSph = (DPIF_PointCloudSpherical *) SOC_translateAddress((uint32_t)result->objOutSph,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)objOutSph != SOC_TRANSLATEADDR_INVALID);objOutSideInfo = (DPIF_PointCloudSideInfo *) SOC_translateAddress((uint32_t)result->objOutSideInfo,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)objOutSideInfo != SOC_TRANSLATEADDR_INVALID);stats = (DPC_ObjectDetection_Stats *) SOC_translateAddress((uint32_t)result->stats,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)stats != SOC_TRANSLATEADDR_INVALID);

#ifdef TRACKERPROC_ON_DSPtList = (trackerProc_Target *)SOC_translateAddress((uint32_t)result->tList,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)tList != SOC_TRANSLATEADDR_INVALID);tIndex = (trackerProc_TargetIndex *)SOC_translateAddress((uint32_t)result->tIndex,SOC_TranslateAddr_Dir_FROM_OTHER_CPU,&errCode);DebugP_assert ((uint32_t)tIndex != SOC_TRANSLATEADDR_INVALID);
#elsetList = (trackerProc_Target *)(result->tList);tIndex = (trackerProc_TargetIndex *)(result->tIndex);
#endif}outputMessage.subFrameNumber = 0;/* Start: Tracker output code */outputMessage.frameNumber = stats->frameStartIntCounter;//outputMessage.chirpProcessingMargin = srcAddress->header.chirpProcessingMarginInUsec;//outputMessage.frameProcessingMargin = srcAddress->header.frameProcessingMarginInUsec;//outputMessage.trackingProcessingTime = gMmwMssMCB.mssDataPathObj.cycleLog.trackingTimeCurrInusec;//outputMessage.uartSendingTime = gMmwMssMCB.mssDataPathObj.cycleLog.sendingToUARTTimeCurrInusec;outputMessage.timeStamp = Cycleprofiler_getTimeStamp();outputMessage.numTLVs = 0;outputMessage.checksum = 0;packetLen = sizeof(TrackerDemo_output_message_header);/* Point cloud and side info */if (result->numObjOut > 0){/* Point cloud */tl[tlvIdx].type = 6;//MMWDEMO_OUTPUT_MSG_DETECTED_POINTS;tl[tlvIdx].length = sizeof(DPIF_PointCloudSpherical) * result->numObjOut;packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;outputMessage.numTLVs += 1;tlvIdx++;/* Side info */tl[tlvIdx].type = 9;//MMWDEMO_OUTPUT_MSG_DETECTED_POINTS_SIDE_INFO;tl[tlvIdx].length = sizeof(DPIF_PointCloudSideInfo) * result->numObjOut;packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;outputMessage.numTLVs += 1;tlvIdx++;}if(result->numTargets) {/* Point cloud */tl[tlvIdx].type = 7;//TRACKERPROC_OUTPUT_TARGET_LIST;tl[tlvIdx].length = sizeof(trackerProc_Target) * result->numTargets;packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;outputMessage.numTLVs += 1;tlvIdx++;}if(result->numIndices) {/* Point cloud */tl[tlvIdx].type = 8;//TRACKERPROC_OUTPUT_TARGET_INDEX;tl[tlvIdx].length = sizeof(trackerProc_TargetIndex) * result->numIndices;packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;outputMessage.numTLVs += 1;tlvIdx++;}tl[tlvIdx].type = 10;//MMWDEMO_OUTPUT_MSG_L3_DATA;tl[tlvIdx].length = subFrameCfg->numRangeBins * subFrameCfg->numDopplerBins * subFrameCfg->numVirtualAntennas * 4 + 2;packetLen += sizeof(MmwDemo_output_message_tl) + tl[tlvIdx].length;tlvIdx++;/* Round up packet length to multiple of MMWDEMO_OUTPUT_MSG_SEGMENT_LEN */outputMessage.totalPacketLen = MMWDEMO_OUTPUT_MSG_SEGMENT_LEN *((packetLen + (MMWDEMO_OUTPUT_MSG_SEGMENT_LEN-1))/MMWDEMO_OUTPUT_MSG_SEGMENT_LEN);/* Calculate header checksum */headerPtr = (uint16_t *)&outputMessage;for(n=0, sum = 0; n < sizeof(TrackerDemo_output_message_header)/sizeof(uint16_t); n++)sum += *headerPtr++;outputMessage.checksum = ~((sum >> 16) + (sum & 0xFFFF));/* Always send a packet header */UART_writePolling (uartHandle, (uint8_t *)&outputMessage, sizeof(TrackerDemo_output_message_header));tlvIdx = 0;/* Send detected objects and side info*/if(result->numObjOut > 0) {UART_writePolling (uartHandle,(uint8_t*)&tl[tlvIdx],sizeof(MmwDemo_output_message_tl));Task_sleep(1);/*Send array of objects */UART_writePolling (uartHandle, (uint8_t*)objOutSph,sizeof(DPIF_PointCloudSpherical) * result->numObjOut);tlvIdx++;Task_sleep(1);UART_writePolling (uartHandle,(uint8_t*)&tl[tlvIdx],sizeof(MmwDemo_output_message_tl));Task_sleep(1);/*Send array of objects */UART_writePolling (uartHandle, (uint8_t*)objOutSideInfo,sizeof(DPIF_PointCloudSideInfo) * result->numObjOut);tlvIdx++;Task_sleep(1);}if(result->numTargets > 0) {/* If any targets tracked, send send target List TLV  */UART_writePolling (uartHandle,(uint8_t*)&tl[tlvIdx],sizeof(MmwDemo_output_message_tl));Task_sleep(1);UART_writePolling (uartHandle, (uint8_t *)(tList),sizeof(trackerProc_Target) * result->numTargets);tlvIdx++;Task_sleep(1);}if(result->numIndices > 0) {/* If exists, send target Index TLV  */UART_writePolling (uartHandle,(uint8_t*)&tl[tlvIdx],sizeof(MmwDemo_output_message_tl));Task_sleep(1);UART_writePolling (uartHandle, (uint8_t *)(tIndex),sizeof(trackerProc_TargetIndex) * result->numIndices);tlvIdx++;Task_sleep(1);}uint32_t *outdata;outdata = 0x51000000;UART_writePolling (uartHandle,(uint8_t*)&tl[tlvIdx],sizeof(MmwDemo_output_message_tl));CRC16Bit = crc16_ccitt((uint8_t*)(&outdata[0]), tl[tlvIdx].length-2);UART_writePolling(uartHandle, (uint8_t*)(&outdata[0]), tl[tlvIdx].length-2);UART_writePolling(uartHandle, (uint8_t*)&CRC16Bit, 2);/* Send padding bytes */numPaddingBytes = MMWDEMO_OUTPUT_MSG_SEGMENT_LEN - (packetLen & (MMWDEMO_OUTPUT_MSG_SEGMENT_LEN-1));if (numPaddingBytes<MMWDEMO_OUTPUT_MSG_SEGMENT_LEN){UART_writePolling (uartHandle,(uint8_t*)padding,numPaddingBytes);}/* End: Tracker output code */

}

chirp_configs的配置如下:

% ***************************************************************
% Created for Traffic Monitoring 18xx v2.0.x
% Frequency:77
% Platform:xWR18xx
% Azimuth Resolution(deg):15 + Elevation
% Range Resolution(m):0.366
% Maximum unambiguous Range(m):75.0
% Maximum Radial Velocity(m/s):9.01
% Radial velocity resolution(m/s):0.4509
% Frame Duration(msec):50
% ***************************************************************

% *****************STANDARD MMWAVE SDK COMMANDS******************
sensorStop
flushCfg
dfeDataOutputMode 1
channelCfg 15 7 0
adcCfg 2 1
adcbufCfg -1 0 1 1 1
profileCfg 0 77 8 7 28 0 0 20 1 256 12500 0 0 48
chirpCfg 0 0 0 0 0 0 0 1
chirpCfg 1 1 0 0 0 0 0 4
chirpCfg 2 2 0 0 0 0 0 2
frameCfg 0 2 40 0 50 1 0
lowPower 0 0
guiMonitor -1 1 0 0 0 0 0
cfarCfg -1 0 2 8 4 3 0 10 0
cfarCfg -1 1 0 4 2 3 1 12 0
multiObjBeamForming -1 1 0.5
clutterRemoval -1 1
calibDcRangeSig -1 0 -5 8 256
extendedMaxVelocity -1 1
bpmCfg -1 0 0 1
lvdsStreamCfg -1 0 0 0
compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
measureRangeBiasAndRxChanPhase 0 1.5 0.2
CQRxSatMonitor 0 3 5 121 0
CQSigImgMonitor 0 127 4
analogMonitor 0 0
aoaFovCfg -1 -90 90 -90 90
cfarFovCfg -1 0 0 80
cfarFovCfg -1 1 -30 30.00

% *****************TRACKING COMMANDS*****************************
staticBoundaryBox -40 40 20 70 -0.5 3
boundaryBox -50 50 10 80 -0.5 3
gatingParam 20 15 15 15 200
stateParam 15 10 10 1000 10 1000
allocationParam 60 50 1 3 5 50.0
maxAcceleration 50 50 0.1
trackingCfg 1 2 250 20 90 450 50
sensorPosition 2 0 0
presenceBoundaryBox -3 3 2 6 0.5 2.5

% *****************SENSOR START*********************
sensorStart

Shine:

请问使用的是哪个版本的例程?我看2.4章节里写的是MmwDemo_transmitProcessedOutput。

在“MmwDemo_transmitProcessedOutput” TASK 中增加如下代码 即可实现数据的外送,

,

xin:

你好,我是用的Traffic_monitoring这个案例,案例是官网下载最新的版本。

,

Shine:

我去文档工程师确认一下是否可以用在Traffic_monitoring,文档里用的是mmw demo示例。

,

xin:

好的,期待您的解决方案。

,

Shine:

请看我们工程师的建议。

原理是一样的。可能需要做一些微小调整。

可以尝试做以下几步:

确定是否是EVM,如果不是,需要看一下USB-串口模块是否支持3.125Mbps
调通串口发送数据的代码。
降低帧率,50ms时间太短了,然后再进行尝试。
使用CCS DEBUG模式,进行单步调试。

,

xin:

好的,我去试一试,然后再反馈给您。

,

Shine:

好的

,

xin:

你好,我试了Debug模式可以从串口得到数据,但是返回的数据总是固定的大小,有2MB左右,但是我们计算应该是480KB的数据,看了0x51000000的地址的数据是对得上的,但是输出的数据对不上,我们测试了多次,得到了多次的数据(其中我们在2m的距离放了反射镜与没有放反射镜的比较),但是用MATLAB看得到的ADC原始数据都是一样的,请问这是怎么回事呢?

,

Shine:

我去问一下工程师。

,

Shine:

请看下面工程师的回复。建议发送固定的累加数,确保链路是通的,正确的,再用ADC数据。接下来需要您调试自己代码的BUG。

,

xin:

好的,我试一试,过后反馈一下。

赞(0)
未经允许不得转载:TI中文支持网 » AWR1843BOOST: SDK使用低速串行总线的实时 ADC 原始数据采集方法遇到的问题
分享到: 更多 (0)