And use the drivers that are linked in that post with the fatfs middleware. I got it successfully working on an stm32l476rg-nucleo with an SD card break out board from adafruit.
Yes, the AdaFruit SPI implementation (see BSP) for NUCLEO is also a good starting point but the NUCLEO-L476RG also supports SDMMC and will be significantly faster.
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
I tried the SD card integration as per the link you mentioned. Do you have any idea on why i am getting send_cmd(CMD0, 0) is returning 0xFF.(user_diskio_spi.c line no.337)
I cant quite be sure on why either. Your code does look fine. Maybe play around a bit more with the clock speeds. The command you mention is supposed to put the SD card into "SPI/Idle state". I would double check or triple check your connections to the board. Are you using some sort of breakout board for the SD card? How is it wired?
Thanks for your update. I double checked the connections and could not find anything wrong. I am using a 6 pin SD card break out board and its wired using jumper wires.