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.

AWR1642: Transfer target data via serial communication protocol

Part Number: AWR1642
Other Parts Discussed in Thread: IWR1443

I have a GUI sample code from TI that write target tracking data to PC via UART. Currently, I'm trying to transfer target data between 2 TI EVMs or 1 TI EVM & Rapsberry Pi via SPI/I2C then display point cloud on GUI. 

My model uses 2 EVMs (Master for SPI_read & Slave for SPI_Slave). After SPI_read on Master, I want to demo point cloud on GUI. I want to test this function before implementing SPI with Wifi module.

Below is my short code on Master EVM for SPI_read. I declared spiDataMsg as a data structure to store target tracking data. After SPI_read, data will be put into spiMsg and return it to UART_write.

I tried it but I didn't see any point cloud on GUI and data frame didn't start after I sent Configuration and target data from Slave.

Please give me sample code for this purpose or any instruction will be appreciated.

spiDataMsg* Test_oobRangeProfile(void)
{
 ...
  spi_Read(handle, (void *)rxBuf, SPI_DATA_BLOCK_SIZE);
  spiMsg = (spiDataMsg *)&rxBuf[0];

  return spiMsg;
}

static void MmwDemo_transmitProcessedOutput
(
    UART_Handle     uartHandle,
    DPC_ObjectDetection_ExecuteResult   *result,
    MmwDemo_output_message_stats        *timingInfo
)
{

    pTestMsgOut = Test_oobRangeProfile();
    UART_writePolling (uartHandle,
                       (uint8_t*)&(pTestMsgOut->msgId),
                       sizeof(MmwDemo_output_message_header));

    UART_writePolling (uartHandle,
                           (uint8_t*)&pTestMsgOut->data[tlvIdx],
                           sizeof(MmwDemo_output_message_tl));
}

  • Hi,

    I would recommend you try sending a buffer of known data first before sending the point cloud.

    There is a TI Design where SPI was implemented between an xWR device and an MSP430 device. This may be helpful to you.

    http://www.ti.com/tool/TIDEP-0091

    Thank you

    Cesar

  • Hi Cesar,

    1. I saw in iwr1443 code has SOC_SPIOutputCtrl(). When do I need to use it?

    2. I have done SPI write/read between 2 EVMs successfully. On Master, after SPI_read, I store target data in a buffer and assign its value to a data structure. But when I do System_printf() to print target data, I turned off Slave to see how results change, weirdly, Master still get all target data = 65525, it should be 0. Please explain why Master didn't get data from Slave correctly.

    while(1)
        {
            // Every SPI transfer is expected to be 128 bytes
            Test_spiRead(handle, SPI_TEST_MSGLEN, (void *)rxBuf, 0U); // Slave 0
    		for(i = 0; i < SPI_DATA_BLOCK_SIZE; i++)
    		{
                        spiMsg = (spiDataMsg *)&rxBuf[i];
                        System_printf("TLV header: %d TLV data length: %d TLV data: %d\n", spiMsg->msgId, spiMsg->dataLen, spiMsg->data[i]);
                    }
        }

  • Hi Cesar,

    I checked source code you mentioned. I see SPI params.pinMode = SPI_PINMODE_3PIN.

    1. Why did they only use 3 pins in IWR1443 program? When do we use 3 pins or 4 pins mode? 

    2. ramBufLen = sizeof(LSDemo_ChirpData)*2  or MIBSPI_RAM_MAX_ELEM. How much is MIBSPI_RAM_MAX_ELEM? Is it fixed or I have to modify it according to my application? If it's needed to modify sometimes, how to determine its value?

    Why did they set ramBufLen = sizeof(LSDemo_ChirpData)*2  instead of MIBSPI_RAM_MAX_ELEM?

    3. When I declare pinmux of both UART & SPI, UART_init() and SP_init() at the same function, both UART & SPI can't work. I also see in the source code of  TIDEP-0091 they only initialize SPI on IWR1443 code and disable UART. But on Master device, I must run both UART and SPI to demo point cloud on GUI. How can I initialize and make UART & SPI work at the same program?

  • Hi,

    The SPI related information provided in the other threads should apply.

    Please check device datasheet regarding the mux of spi and Uart pins.

    You will notice that some uart and spi functionality is muxed on the same pins.

    Thank you

    Cesar

    https://e2e.ti.com/support/sensors/f/1023/t/907305

     

    https://e2e.ti.com/support/sensors/f/1023/t/905789