2012-08-27 06:40 AM
Hi,
I am working on read,write to a SD card using SPI method on board STM32152L-Discovery board. Now I can create a folder, create a file, and read, write. But when I want to get the capacity of the SD card, no matter I use 1GB SD card or 2 GB SD card, I get DeviceSize 2037672302, CardCapacity 1380012885, CardBlockSize 12628。 Any ideas? Thank you.2012-08-27 08:32 AM
Sounds like a structure is not being initialized to zero, and status/errors are being ignored.
2012-08-27 08:57 AM
In that case, how should I do?
Thank you.2012-08-27 05:55 PM
I'd guess I'd start by looking carefully at the code, the flow, and the content of data structures and variables along the way.
Look at what the tool chain is creating, and if structures are being initialize as expected. You could use memset() to get known values into some structures. You'll need to review how you do error propagation, and delve into library code to see why/where things fail with the SD card interface. I'm not able to deduce much about your code, or tool chain from the information in the thread.