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.

CCS/SIMPLELINK-CC3220-SDK: v1.50.00.06: SPI_transfer() in blocking slave mode (rx only) always returns no valid data if DMA is used internally

Part Number: SIMPLELINK-CC3220-SDK

Tool/software: Code Composer Studio

If I setup my spi interface as slave to receive a block of data (SPI_Transfer from SDK), it returns no valid data if the DMA is used internally (dataSize > minDmaTransferSize).

Once I change the transfer size below minDmaTransferSize (100) by either transfer less data or by increasing the dataSize and lowering the count, spiPollingTransfer() is used internally (see SPICC32XXDMA.c) and the correct data gets received.

So it seems to me, there's an issue in the sdk/driverlib spi/dma code.

here's part of my code:

#define TRANSFER_SIZE        256

static Event_Struct ev_struct;
#define ev_handle       Event_handle(&ev_struct)
#define EV_SPI_SLAVE    Event_Id_00

static SPI_Handle spi_handle;
static SPI_Params spi_params;
static SPI_Transaction spi_trans;

static uint8_t rx_buf[TRANSFER_SIZE];

void thread(UArg arg0, UArg arg1)
{
    Event_construct(&ev_struct, NULL);
    SPI_init();

    SPI_Params_init(&spi_params);
    spi_params.dataSize = 8;
    spi_params.mode = SPI_SLAVE;
    spi_params.transferMode = SPI_MODE_BLOCKING;

    while (1) {
        // wait on event
        Event_pend(ev_handle, Event_Id_NONE, EV_SPI_SLAVE, BIOS_WAIT_FOREVER);

        spi_handle = SPI_open(Board_SPI0, &spi_params);

        spi_trans.rxBuf = rx_buf;
        spi_trans.txBuf = NULL;
        spi_trans.count = TRANSFER_SIZE;

        if (SPI_transfer(spi_handle, &spi_trans)) {
            UART_PRINT("got date over spi\r\n");
        } else {
            UART_PRINT("error on spi transfer\r\n");
        }

        // check content of rx_buf here

        SPI_close(spi_handle);
    }
}