Posted on February 20, 2018 at 12:47The original post was too long to process during our migration. Please click on the attachment to read the original post.
You're probably trashing the memory in the system because your BSP_SD_ReadBlocks() is trying to read into a 32-bit word. If you want to read/write 10 512-byte blocks you're going to need to use a 5KB block of RAM to achieve that.
Also writing to arbitrary blocks runs the risk of trashing the file system on the card.
Perhaps skip the block test, and see if FatFs functions better without them.
There seems to be an odd mix of references to SDIO and SPI to access the card
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
There have been several thread on these types of issues, you'd want to instrument BSP_SD_ReadBlocks() to understand the interactions there, and perhaps reflect those in your initial read test.
You could see if less aggressive clocking works.
Not familiar with the socket/wiring in use here. I generally recommend using sockets with pull-ups there rather than on the STM32 side.
Here we use the STM32F407G-DISCO we use the STM32F4DIS-BB breakout board with microSD socket.
Look also at using the HAL examples rather than the CubeMX generated stuff, I'm not wading into debugging exercise with Cube.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..