I want to use a micro sd slot for my project and for testing purposes I firstly tried the emfile example project. The programme itself seems to work. The name of the sd card should be displayed on an lcd and creates a file on the sd card. If something fails, you get the information displayed on the lcd.
Now the problem:
I always get the the information that all steps that should have been performed had failed. So it seems there is no connection between PSoC and the sd card!? According to the datasheet, the connections are right. I also included the library.
Read about that everything should work without any additional pull-up resistors. And since there is no comment about it in the sheet of the example I think with this point I am save.
Searched the community here and found a topic where the wrong pins were used. Changed pins, no success.
Does anyone have some ideas where my mistake is?
Thanks in advance for some helpful input,
bit difficult without a project workspace to guess what is not working. And some info about the underlying hardware (Kit? which??), SD-card size would be helpful, too.
But in the cypress datasheet for emfile they say you can use higher capacity cards. You just need to use FAT32 for more than 2 GB. So this shouldnt be a problem
update: just used another sd card slot, now the programme says that it detects the sd card and all steps are ok, except the last one (copy file). According to the programme, a txt file was created on the sd card, but when I open the sd card with my computer, it is empty
I had the failure issue above as well, and am posting something that worked for me in hopes of helping others (I've seen this issue on several forums). I don't know exactly which part of my solution actually fixed the problem, so you can try one or try them all! I got the example to work on a PSoC 5LP using the CY8CKIT-050.
1. Formatted the SD Card using the SDFormatter 4. This is the formatting tool supplied by SanDisk and they claim it's "the best" way to format an SD card.
2. Changed the SPI pins to be:
SCLK = P12.4
MOSI = P12.3
MISO = P12.2
CS = P12.0
Hope this helps someone!
Thank you so much! I have no idea why changing the pins did the trick. Do those pins have some internal logic that causes them to work?
I was going through your file (trying to shamelessly copy the code) and found that the source files of FS_ConfigIO.c and FS_X_OS.c are not there. Maybe that's causing the problem.
Also in case you got the program to work out, please post your final bundle here. (For me to copy)
Is there any example code of that library working with a 4Gb SDCard?
If I will need to use a bigger SDCard like 8 or 16Gb, what can I use? - PSoC hasn't support that kind of memories??