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.

MSP432P401R: SPI transaction issues with TI-RTOS

Part Number: MSP432P401R

Hi,

I am using the MSP432 to send data using SPI. My code runs on tirtos and I am using SPI_transfer(slaveSpi, &transaction) to send the data. The data size I am sending is 1000 bytes.

I set up the SPI in blocking mode 

spiParams.frameFormat = SPI_POL0_PHA0; // SPI_POL0_PHA1;
spiParams.transferMode = SPI_MODE_BLOCKING; 
spiParams.mode = SPI_SLAVE;
spiParams.transferCallbackFxn = transferCompleteFxn; 
spiParams.bitRate = 12;
spiParams.dataSize = 8;

When I send the data, the master receives the block of data correctly.

The problem is that the SPI_transfer function never returns and no other data is sent. On some occasions, the first packet is sent, but the 2 second hangs. The 2 data packets are received by the master. 

I have also tried the SPI_MODE_CALLBACK, but the callback doesn't get called and the code hangs on the semaphore. 

My question is what conditions would prevent the SPI_transfer() function from returning? 

Thanks for your help.

Malcolm

  • Hello Malcom,

    I would start with the following application note to help you debug SPI. Common Solutions to USCI and eUSCI Serial Communications It is geared towards MSP430, but the MSP430 and MSP432 utilize the same module (eUSCI) for SPI. 

    It might also help to utilize a logic analyzer or an O-scope with logic analyzer capabilities to see where in your data stream the communication halts. This should help you narrow down in the code where to investigate. You can also set break points in between your transfers to look at your registers to make sure nothing gets changed as well.