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.

IWR1843: 关于ADCBUF读取数据的问题

Part Number: IWR1843
Other Parts Discussed in Thread: SYSBIOS

你好,

我在MSS程序定义了如下参数

#define TX_CHANNEL_NUMS (3U)  //发射天线数
#define RX_CHANNEL_NUMS (4U) //接收天线数
#define Doppler_Number (8U) //chirp数

#define PROFILE_ADC_SAMPLE_VAL (256U) //采样点数

然后我在监听器定义串口发送的函数,在chirp数达到SUBFRAME_USRR_NUM_CHIRPS_TOTAL(3*8)时将数据通过UART从ADCBUF发送出去

static void MRR_MSS_chirpIntCallback(uintptr_t arg)
{
    gMrrMSSMCB.chirpInt++;
    gMrrMSSMCB.chirpIntcumSum++;
    
    if (gMrrMSSMCB.chirpInt == SUBFRAME_USRR_NUM_CHIRPS_TOTAL)
    {
    gMrrMSSMCB.chirpInt = 0;
    
    Semaphore_post(gMrrMSSMCB.uartSendSemHandle);
    }
}

串口发送的数据大小

        UART_writePolling (gMrrMSSMCB.loggingUartHandle,
                           (uint8_t*)gMrrMSSMCB.adcDataBuf,
                           4*TX_CHANNEL_NUMS*RX_CHANNEL_NUMS*Doppler_Number*PROFILE_ADC_SAMPLE_VAL);

但是出现以下错误,

[Cortex_R4_0] Debug: Launched the Initialization Task
Debug: frame and chirp interrupt initialized
Debug: Initialized the mmWave module
Debug: Synchronized the mmWave module
Debug: uartSendSemHandle is created
Set LDO Bypass
Debug: MMWave has been configured for MRR.
Debug: Sensor will start momentarily. 
Exception occurred in ThreadType_Task.
Task handle: 0x8001ba8.
Task stack base: 0x8001c08.
Task stack size: 0x1000.
R0 = 0x52008000  R8  = 0xffffffff
R1 = 0x0800b638  R9  = 0xffffffff
R2 = 0x00000008  R10 = 0xffffffff
R3 = 0x00000001  R11 = 0xffffffff
R4 = 0xfff7e700  R12 = 0x08001ba8
R5 = 0x08000cb0  SP(R13) = 0x08002ba8
R6 = 0x00010000  LR(R14) = 0x0000be19
R7 = 0x52000000  PC(R15) = 0x0000d01c
PSR = 0x800c019f
DFSR = 0x00000008  IFSR = 0x00000000
DFAR = 0x52008000  IFAR = 0x00000000
ti.sysbios.family.arm.exc.Exception: line 205: E_dataAbort: pc = 0x0000d01c, lr = 0x0000be19.
xdc.runtime.Error.raise: terminating execution

如果串口发送的数据量小一点就可以发送,如果改成大小4*RX_CHANNEL_NUMS*Doppler_Number*PROFILE_ADC_SAMPLE_VAL

就可以经串口发送数据,这时就是4个接收天线1个发送天线的数据了,

但这显然是不对的,请问您怎么看?

  • 是不是ADCBUF只能存储一个发射天线的数据?

  • 您好,您的问题我们升级到英文论坛看下,有答复尽快给到您。

  • 感谢回复,主要是ADCBUF中四个天线的数据是怎么排列的我不清楚;假设每次经过1个chirp ADCBUF更新一次,如果按照这个图来看的话,就是说在1个CHIRP内四个接收天线都有数据,并且只有一个chirp数据,那按照这个图的理解就是按照天线数排列所有的采样点数。

    但是我从EMDA的乒乓数据读取上看到天线0和天线2是存储在一起的,天线1和天线3是存储在一起的,那这样的话是不是他从ADCdataBuf[0]存储的是天线0和天线1的连续数据,

    ADCdataBuf[(ADCBufferoffset>>2){这里的偏移是ADCBUF的一半内存}存储的是天线1和天线3的连续数据?

            /* Ping - copies chirp samples from even antenna numbers (e.g. RxAnt0 and RxAnt2) */
    
            if (subframeIndx == 0)
            {
                chId = MRR_SF0_EDMA_CH_1D_IN_PING;
            }
            else
            {
                chId = MRR_SF1_EDMA_CH_1D_IN_PING;
            }
    
            retVal =
                EDMAutil_configType1(obj->edmaHandle[EDMA_INSTANCE_DSS],
                    (uint8_t *)(&obj->ADCdataBuf[0]),
                    (uint8_t *)(SOC_translateAddress((uint32_t)&obj->adcDataIn[0], SOC_TranslateAddr_Dir_TO_EDMA, NULL)),
                    chId,
                    false,
                    shadowParam++,
                    obj->numAdcSamples * BYTES_PER_SAMP_1D,
                    MAX(obj->numRxAntennas / 2, 1),
                    ADCBufferoffset * 2,
                    0,
                    eventQueue,
                    NULL,
                    (uintptr_t)obj);
            if (retVal < 0)
            {
                return -1;
            }
    
            if (subframeIndx == 0)
            {
                chId = MRR_SF0_EDMA_CH_1D_IN_PONG;
            }
            else
            {
                chId = MRR_SF1_EDMA_CH_1D_IN_PONG;
            }
    
            /* Pong - copies chirp samples from odd antenna numbers (e.g. RxAnt1 and RxAnt3)
             * Note that ADCBufferoffset is in bytes, but ADCdataBuf is in cmplx16ReIm_t.
             * There are four bytes in one cmplx16ReIm_t*/
            retVal =
                EDMAutil_configType1(obj->edmaHandle[EDMA_INSTANCE_DSS],
                    (uint8_t *)(&obj->ADCdataBuf[(ADCBufferoffset>>2)]),
                    (uint8_t *)(SOC_translateAddress((uint32_t)(&obj->adcDataIn[obj->numRangeBins]), SOC_TranslateAddr_Dir_TO_EDMA, NULL)),
                    chId,
                    false,
                    shadowParam++,
                    obj->numAdcSamples * BYTES_PER_SAMP_1D,
                    MAX(obj->numRxAntennas / 2, 1),
                    ADCBufferoffset * 2,
                    0,
                    eventQueue,
                    NULL,
                    (uintptr_t)obj);
            if (retVal < 0)
            {
                return -1;
            }

  • 我已经将数据读出来了,但是不确定读的对不对;每当经过1个chirp,就将SOC_XWR18XX_MSS_ADCBUF_BASE_ADDRESS地址的adcbuf[0],adcbuf[SOC_XWR18XX_MSS_ADCBUF_BASE_ADDRESS+0x2000],adcbuf[SOC_XWR18XX_MSS_ADCBUF_BASE_ADDRESS+0x4000],adcbuf[SOC_XWR18XX_MSS_ADCBUF_BASE_ADDRESS+0x6000]读出来,直到读完所有的chirp(发射天线数*多普勒循环数,3*16),然后经串口发送出去,但这样读数据是对的吗?

  • 您好,请看以下答复:

    数据中止错误似乎表明程序正在尝试访问一个无效的存储器地址,这表明对 ADCBUF 的访问不正确。 请查看下帖,了解有关 ADCBUF 的更多信息: (+) AWR1843: How to configure ADC channels by using ADCBuf APIs

    如上贴所示,请参考Technical Reference Manual (TRM)确保完全了解 ADCBUF 存储器,以便正确读取。