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.

CC3220MOD: SPI communication

Part Number: CC3220MOD
Other Parts Discussed in Thread: CC3220S

Hi,

i have been trying to communicate slave device with SPI. I refer to the below code from Resource Explorer / TI-Drivers API Documentation. But, I couldnt initiate SPI communication. Should i do something else as a configuration ?  Maybe in CC3220S_LAUNCHXL.c or CC3220S_LAUNCHXL.h files ?  

One more question, PIN_08 is configured CS for SPI1, How i can manage CS ?  

Pins 

PIN_07   MOSI,

PIN_06   MISO,

PIN_05   CLK,

PIN_08   CS

Reference Code

SPI_Params spiParams;
SPI_Transaction spiTransaction;
uint8_t transmitBuffer[MSGSIZE];
uint8_t receiveBuffer[MSGSIZE];
bool transferOK;
SPI_init(); // Initialize the SPI driver
SPI_Params_init(&spiParams); // Initialize SPI parameters
spiParams.dataSize = 8; // 8-bit data size
spi = SPI_open(Board_SPI0, &spiParams);
if (spi == NULL) {
while (1); // SPI_open() failed
}
// Fill in transmitBuffer
spiTransaction.count = MSGSIZE;
spiTransaction.txBuf = transmitBuffer;
spiTransaction.rxBuf = receiveBuffer;
transferOK = SPI_transfer(spi, &spiTransaction);
if (!transferOK) {
// Error in SPI or transfer already in progress.
}
  • Hi Can Cagdas Yesildag,

    It looks like your are doing everything right.
    If you are working with CC3220S_LAUNCHXL.c from the SDK example, you should be fine (as you are using the default configuration).

    Are you using the latest SDK 1.50.00.06? If so, there is a known SPI driver bug (see the e2e post below). e2e.ti.com/.../2349994

    You may revert to SDK1.40 and check the same example again.
    The issue relates to DMA, so you can also limit the transaction size to less than the DMA threshold (100).

    This SPI driver issue will be fixed in our next SDK release.

    Br,
    Kobi