cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55RGV6 Can pin PC15 be used as the NSS(software) for the SPI bus? Pin PC10 and PC6 are ok. But pin PC13,PC14,PC15 doesn't work.

Lep
Senior

My configuration is shown below:

 gpioinitstruct.Pin  = SD_CS_PIN;

 gpioinitstruct.Mode  = GPIO_MODE_OUTPUT_PP;

 gpioinitstruct.Pull  = GPIO_PULLUP;

 gpioinitstruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(SD_CS_GPIO_PORT, &gpioinitstruct);

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

PC14 and PC15 aren't connected to an output on that board by default. Need to close some solder bridges and remove the LSE crystal.

0693W00000Kc84DQAR.png 

0693W00000Kc89MQAR.png 

PC13 should work as far as I can tell, if it's not being used by the RTC.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

7 REPLIES 7
TDK
Guru

> Can pin PC15 be used as the NSS(software) for the SPI bus?

Yes, it's a GPIO pin and you can toggle it.

PC15 has limited current capability, but shouldn't be an issue for a CS pin.

See notes in datasheet on PC15. RTC settings will override GPIO settings.

0693W00000Kc2h8QAB.pngAlso ensure PC15 on your board is free and not acting as OSC32_OUT.

If you feel a post has answered your question, please click "Accept as Solution".

0693W00000Kc2s1QAB.jpg0693W00000Kc2saQAB.pngLSE is disable.My test includes P_Nucleo_WB55 and a TF card module.I use FATFS in spi mode.I use the example program which named FatFs_uSD_Standalone.I just changed the SD_CS_PIN and the gpio configuration. I don't kown why it doesn't work.

When i use pin PC10 and PC6, it's work well.But when i use pin PC13, PC14, PC16, it's doesn't work in same gpio configuration:GPIO_MODE_OUTPUT_PP, GPIO_SPEED_FREQ_LOW,GPIO_SPEED_FREQ_LOW.

I have see notes in datasheet: LSE is disable and the gpio's speed is low.`Is there anything else I need to do?

PC13 PC14 PC15(NOT PC16)

TDK
Guru

PC14 and PC15 aren't connected to an output on that board by default. Need to close some solder bridges and remove the LSE crystal.

0693W00000Kc84DQAR.png 

0693W00000Kc89MQAR.png 

PC13 should work as far as I can tell, if it's not being used by the RTC.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you.This problem has been bothering me for several days😁

The cause of this problem is that my schematic is wrong.I just pull up the CS pin in TF card module.I forgot to connect the pin CS of the TF module in the spi mode.So I remove the LSE and I use jumper cables to connect pin PC15 and pin CS. I use the official routines which  named FatFs_uSD_Standalone. I commented out the LEDs and used only spi and FATFS. But it doesn't work.The schematics are shown below.In my own project, I am not using LSE and configure according to the datasheet.I don't know how to proceed...😂

0693W00000KcLgJQAV.png0693W00000KcLg9QAF.png0693W00000KcLg4QAF.png

I have debugged successfully, thanks again!