cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous SPI transactions using DMA

KSGreenA
Associate

A little background first. I'm use the STM32F412 in a custom design and not using STM32Cube packages.

What I want to do is continuously transmit/receive a fixed number of bytes on a SPI interface (master) using DMA with no software interaction (i.e. no polling or interrupts). Between each transaction of fixed number of bytes I need the NSS pin to briefly go high. This last part is where I'm stuck. I can get DMA working with SPI in a continuous manner, but there doesn't appear to be any mechanism for de-asserting NSS between transactions. From what I've gathered in the RM, NSS will only be de-asserted when SPI has been disabled (SPE=0).

1 REPLY 1

> NSS will only be de-asserted when SPI has been disabled (SPE=0).

NSS goes threestate when SPE=0.

I recommend to use to set the NSS pin as GPIO output, and handle it "manually", controlled from the Rx DMA's Transfer Complete interrupt.

JW