PsoC 5lp and sd card, problems with emfile example project

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi community,

   

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,

   

Alex

0 Likes
10 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Alex,

   

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.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Bob,

   

I attached the file. It is the example project emfile. I just changed the lcd parts to uart, but the basic code is unchanged.

   

I am using a micro sd card slot, 4 GB.  I am using a 5lp - 059 kit.

   

Alex

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

emFile max capacity is 2GB, try a smaller card.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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?

0 Likes

For CY8CKIT-059 PSoC 5LP you need to remove the capacitor C12.

In particular, the capacitor C12 is needed for SAR1 EXTREF in one of examples of this board.

It will prevent the pin MISO (P0.2).
More info: Troubleshoot of emFile Example ! help

Thanks,

0 Likes
Anonymous
Not applicable

Hi Alexander,

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)

0 Likes
ANNA_2615691
Level 4
Level 4
First comment on KBA First solution authored 25 replies posted

Hi.

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??

Thank you!

0 Likes