Skip to main content
Associate II
Jul 7, 2025 11:58 AM UTC
Question

NSS Pin not going high when Idle in SPI

Hi,

I am connecting ESP32 with STM32G474RET6 Nucleo board via SPI. I have configured SPI in DMA mode to transfer data. With NSS pin enabled for chip select I can see the pin remains low always during transmission of data and also in idle. So that I could not communicate with ESP32. Because of that I have to do manual GPIO write high and low in the code and that works. How to automate this NSS pin (chip select) to work, Kindly help me with this.

 

Thanks in Advance

This topic has been closed for replies.

3 replies

MasterT
Lead II
Jul 7, 2025 1:54 PM UTC

Pin 'd stay low as long as SPI active.  Use I2S instead, right/left channel line is your NSS in this case. 

Andrew Neil
Super User
Jul 7, 2025 2:02 PM UTC

@MasterT wrote:

Pin 'd stay low as long as SPI active.  Use I2S instead, right/left channel line is your NSS in this case. 


Indeed.

@BrindhaP this is documented in the Reference Manual:

AndrewNeil_0-1751896914419.png

https://www.st.com/resource/en/reference_manual/rm0440-stm32g4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=1835

via: https://www.st.com/en/microcontrollers-microprocessors/stm32g474re.html#documentation

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
AScha.3
Super User
Jul 7, 2025 2:13 PM UTC

Hi,

i have a SPI data DMA transfer between ESP and STM32 also, working fine.

Just : the ESP is SPI master, the STM32 is slave; then NSS (hardware) is input and this works as expected.

If you feel a post has answered your question, please click on " Best Answer ".