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.

RTOS/MSP432P401R: MSP432 SPI Master and Slave Mode Switching

Part Number: MSP432P401R

Tool/software: TI-RTOS

Hi there,

I am having an issue with SPI mode switching between master and slave on MSP432. Can this be done through RF_open with mode set to Master and Slave?

In my test project, MSP432 starts in slave mode and CC2650 starts in master mode. CC2650 wakes up MSP432 through external GPIO and send a ramp data. Once MSP432 receives complete, SPI is closed through SPI_close().

Next, MSP432 will switch SPI mode to Master through SPI_open() and start a transaction (blocking mode). At this step, the system seems stuck in SPI_transfer(). The transfer mode is blocking and transfer timeout is forever. I am not sure if SPI is still pending on something. 

Is SPI mode switching procedure described above correct or additional steps should be done before switching SPI mode.

Thanks!

  • Don't mix SPI modes, let msp432 be always master.
  • Thanks for the quick reply.

    We do plan to use MSP432 as master and CC2650 as slave but just exploring possibility of switching SPI modes. Do you know what might be the reason causing the "stuck" issue?
  • Kaichien (Thomas) Tsai said:
    Do you know what might be the reason causing the "stuck" issue?

    Yes. For the same reason why it is so hard to eat soup using knife and to cut bread using spoon.

  • It's good to remember that SPI is already a 2-way communication channel, with the master initiating the transaction. It's not designed to switch sides the way you are describing. If you do have a need to have the slave side initiate a transfer, then you need another signal (aka "side-band signal" since it's not part of the regular SPI interface) from the slave to generate an interrupt on the master. The master can then perform a transaction requesting the slave's data. This also serves as an "acknowledge" to the slave that the interrupt was received. (nice symmetry there).

**Attention** This is a public forum