cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 SPI Hardware CS

khalid2
Associate II
Posted on July 01, 2014 at 12:40

Hello,

I'm using a STM32F30x as a Slave. The Master is  a custom board that select/deselect the Slave by toggling an output pin. 

In the Slave side i configured the SPI with hardware management, SPI_InitStructure.SPI_NSS = SPI_NSS_Hard; 

There is no difference when it's managed by software SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; 

Someone could have an idea what the difference ?

Thanks in advance 
3 REPLIES 3
khalid2
Associate II
Posted on July 07, 2014 at 15:48

Is there always the problem of Hardware CS with STMF3?

I tried to manage it but no success.

Someone made it work ?

zoharr
Associate II
Posted on July 07, 2014 at 17:34

Hi,

I'm using STM-L1 and not STM-F3 as SPI slave with hardware CS, but I think this can help.

I defined the NSS pin in the STM-L1 (SPI slave) as external interrupt with trigger falling. This EXTI indicate the master select the CS and ready to transfer SPI data.

khalid2
Associate II
Posted on July 14, 2014 at 19:46

Thank you rogel.zohar for your help.

I did the same as you but the problem is that there is no difference between:

SPI_InitStructure.SPI_NSS = SPI_NSS_Hard;  and SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; 

 

For me a hardware CS is when  we don't need to use an external interrupt to detect it. It should operate automatically. May be I make a mistake about the CS stuff. 

Someone can highlight this point please ?

B.R