2022-03-09 07:16 PM
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);
Solved! Go to Solution.
2022-03-10 06:57 AM
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.
PC13 should work as far as I can tell, if it's not being used by the RTC.
2022-03-09 07:38 PM
> 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.
Also ensure PC15 on your board is free and not acting as OSC32_OUT.
2022-03-09 08:58 PM
LSE 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?
2022-03-09 11:29 PM
PC13 PC14 PC15(NOT PC16)
2022-03-10 06:57 AM
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.
PC13 should work as far as I can tell, if it's not being used by the RTC.
2022-03-10 07:05 AM
Thank you.This problem has been bothering me for several days:beaming_face_with_smiling_eyes:
2022-03-11 11:42 PM
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...:face_with_tears_of_joy:
2022-03-12 06:42 AM
I have debugged successfully, thanks again!