Skip to main content
Staly.1
Associate III
August 12, 2020
Question

stm32 spi half-duplex transmit into receive mode

  • August 12, 2020
  • 5 replies
  • 2563 views

the target type is stm32f072, firstly the master transmit data success, slave receive data ok;

should i need to disable spi ,enable BIDIOE in slave. but the slave can't transmit data, how to solve it?

This topic has been closed for replies.

5 replies

prain
Visitor II
August 12, 2020

what is your SPI slave? bidirectional mode is not supported by all SPI devices. It is a request / response protocol. Normal SPI use simultaneous data transfer on miso and mosi lines.

Staly.1
Staly.1Author
Associate III
August 12, 2020

my spi slave is stm32f031, the connection is master MOSI to slave MISO

prain
Visitor II
August 12, 2020

be aware that slave can not initiate a transfer. bus management and clock generation​ can be done only from master side. If you want to send data from slave to master, the master should send junk data to initiate transfer

TDK
August 12, 2020

The master always drives the clock. Slave can only wait for the clock and send out data.

The reference manual has a section on how to do this. You're not trying to have the chip be a master, then turn into a slave, are you? That's not how it should work.

"If you feel a post has answered your question, please click ""Accept as Solution""."