2019-03-06 01:40 AM
I testing SPI using two STM32F411 disco.
One is master, the other is slave.
My problem is only work MOSI , MISO is not working.
I attach my Two source code.
This is setting of my disco board.
Do you have any idea about error of Slave transmit of SPI?
2019-03-06 02:38 AM
On picture, I don't see ground connection between boards.
I only see SCK/MOSI/MISO.
2019-03-06 02:46 AM
supply of power at same usb hub.
So, GND connected by usb mini cable.
2019-03-06 03:07 AM
Anyways, I recommend connecting ground between boards.
Please check MISO/MOSI signals on scope.
And configure a NSS pin on Slave and connect it to ground.
2019-03-06 08:03 AM
connect NSS as well. Match MISO and MOSI on both side. Use SPI 8 bit mode. NSS by SW (choose the GPIO). Use NSS GPIO EXTI interrupt to get event when NSS goes low and high (beginning transmit and process received message). Allow small delay after changing NSS for slave EXTI interrupt to complete before data is being transited.
Use 4 wire bidirectional mode to get started. For slave, I recommend to use DMA in cyclic buffer mode (both TX and RX)