cancel
Showing results for 
Search instead for 
Did you mean: 

SPI slave mode. Getting Started.

d4
Associate III

I'm in the early stages of a project involving SPI.

I need to send data to an stm32f303, from an rPi.

I also need to detect, from the rPi, a GPIO based interrupt to then go read from the stm32.

rPi is master, stm32 is slave.

Can anyone recommend a helpful starting point for getting these things talking?

I'd like to continue learning in C, although python on the rPi is also a possibility.

1 REPLY 1
S.Ma
Principal

Use SPI 4 wires (MISO, MOSI, SCK, NSS).

On STM32, enable EXTI interrupt on both edges of NSS

I assume the SPI has only 1 master and 1 slave.

Then program the SPI DMA to cyclically run over a RAM buffer (say 2 kbyte).

When NSS is going high, analyse the incoming payload and then reinit the DMA to the beginning of the buffer.

This will get you started.