cancel
Showing results for 
Search instead for 
Did you mean: 

NSS pin has no effect on slave STM32F303 nucleo

salman
Associate II

Hello,

I have two STM32F303RE nucleo boards one acting as a master and the other as a slave.I have flashed the SPI examples on both of them that come with the firmware and both master/slave are working properly.

The issue is the example only uses (SCK,MOSI,MISO) and no CS for communicating. Just for testing puposes I changed the config on the slave to

 SpiHandle.Init.NSS        = SPI_NSS_HARD_INPUT;

After resetting both master and slave my expectation was that since I have not configured the master to send any CS , the slave should not be able to respond to the master.

But I see that I am still able to have a correct full duplex communcation.

It is like the NSS active setting on slave has no effect on it?

4 REPLIES 4

> I have not configured the master to send any CS

What CS? You mean, you did not set NSS in any way? How did you connect the boards?

You are using some "library", don't you? Do you knwo exactly what that "library" does? Read out and check the SPI registers content against the RM.

JW

salman
Associate II

the boards only have SCK MOSI MISO and GND pins connected to each other.

My slave SPI CR registers are configured with

SSM=0

SSI=0

SSOE=0

According to RM

NSS output disable (SSM=0, SSOE = 0): if the microcontroller is acting as the master on the bus, this configuration allows multimaster capability. If the NSS pin is pulled low in this mode, the SPI enters master mode fault state and the device is automatically reconfigured in slave mode. In slave mode, the NSS pin works as a standard “chip select�? input and the slave is selected while NSS line is at low level.

So my slave is configured to use the NSS pin as standard chip select but I have not connected that "CS" pin on my board to the master. Still my master is still able to communicate properly with the slave.

salman
Associate II

Connected the NSS pin on the slave to a GPIO on master board. Doesnt matter if I set the master GPIO high or low. Slave communicates with master in both cases ignoring the logic on its NSS pin. Am I missing something?

Do you have set in GPIO the appropriate pin's MODER to AF and AFR to the appropriate value?

JW