Skip to main content
KSGreenA
Visitor II
October 13, 2022
Question

Continuous SPI transactions using DMA

  • October 13, 2022
  • 1 reply
  • 1462 views

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).

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
October 13, 2022

> 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