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.

CC2652R7: SPI_MODE_BLOCKING crashing board?

Part Number: CC2652R7

Hello,

In using the CHIP lock-app example for the LP-CC2652R7, it seems as though using the SPI_transfer() function in slave-mode will lock up the board if a timeout is not specified. Is this expected?

In the example below, if params.transferTimeout = x; is not specified, the board appears to hang - i.e. there is no output on the serial debug.

Note that no data is being transferred over the SPI bus at the time:

void SpiSlaveTask(void * pvParameter)

{
    SPI_Params      params;
    SPI_Transaction transaction;
    uint8_t         rxBuffer[8];
    bool            rc;

    SPI_Params_init(&params);
    params.bitRate = 4000000;
    params.transferMode = SPI_MODE_BLOCKING;
    params.transferTimeout = 500000;    // this has to be specified 
    params.frameFormat = SPI_POL0_PHA1;
    params.mode = SPI_SLAVE;
    SPI_Handle spi = SPI_open(CONFIG_SPI_0, &params);

   

    vTaskDelay(500000);
    PLAT_LOG("DEBUG: SPI-SLAVE running");

    while ( true )
    {
        transaction.count = 1;
        transaction.txBuf = nullptr;
        transaction.rxBuf = (void*)rxBuffer;
        memset(rxBuffer, 0, sizeof(rxBuffer));

        rc = SPI_transfer(spi, &transaction);
        if ( rc )
        {
            PLAT_LOG("DEBUG -> 0x%x", rxBuffer[0]);
        }
        PLAT_LOG("DEBUG: timed out ");
       
    }
}
Actually, the SPI_transfer() doesn't seem to really work at all. Only a count size of "1" will receive some data. Sending more than one byte, and verifying those bytes are sent via a logic analyzer, yields no result whatsoever on the TI side. The SPI_transfer() simply times out and never indicates it hasn't received any data. 
    uint8_t rxBuffer[8];
    . . .
    transaction.count = sizeof(rxBuffer);
    transaction.txBuf = nullptr;
    transaction.rxBuf = (void*)rxBuffer;