cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Master NSS always low in STM32F4

Andres Cao
Associate III
Posted on March 03, 2017 at 12:34

Hi guys!

I'm configuring the Nucleo 64 with the STM32F446RE to use SPI as a Master.

The problem I'm having right now is that the NSS pin is always low. Clock and MOSI are perfect. What I would like is that the NSS is high, and goes low during the transmission, then high again.

I've tried setting the NSS as Hardware output, and Software in Cube, but still failed to get what I want. 

I think this configuration should be sorted with the following 3 bits, from CR1 and CR2. Right now Cube is setting SSOE= 1, SSM=1, SSI=1. And the NSS pin is configured as hardware output in Cube. 

0690X00000606TiQAI.png0690X00000606TjQAI.png

Any clues on how should I setup this? I would like to avoid having to use a random pin as CS and pull it manually.

Thanks!!

30 REPLIES 30

Ah, that explains the behavior. The part expects to be actively driven only. You could try an external pull-up of 500 ohms or less. I think then you would see it rise up better. However, with a very strong pull-up, you might have trouble fully driving it low, not to mention simply wasting a lot of power.

I do think it's unfortunate that the ST SPI driver works in this way, regardless of whether or not it's considered a bug.