Edit : (I did not know how to edit initial post)
Interesting fact that might be a lead : I measured voltage with a voltmeter (DC mode) and I couldn't measure anything except for CS pin.
I didn't expect much since it's supposed to be serial communication but the the CS pin voltage was around 4.7V which I find weird since my card reader is working in 3.3V and I don't know if it could be related ?
Also the card reader is powered on by external source with 3.3V regulator.
Does someone know what could go wrong in my project ?
emFile_Example01.zip 4.2 MB
I've downloaded your project. I get a compile error: "Build error: MMC_X_HW.h: No such file or directory". Therefore I can't help much further at this time.
[Solved!] Your build settings point to the emFile info in the C: directory.
I'm currently looking at your project...
Hi thank you for your interest in my problem. I had to change the path of my emfile "emFile_v322c" files to my hard disk C:\ because I had a path problem..
The error that you mention was the one that I had before moving the files.
I've been trying to make the project in the initial topic work and finally it seems to be working.
Although the name is still "mmc:0:"
The most difficult part was finding a SD card interface... I have a nice colleague ;-)
Anyway, I spent whole morning without success.
Then a few minutes ago I noticed that the media detect signals needed to be connected!
So I connected them with the BLUE Jumper pin, then the program started working!
FYI, I used libemf32noslfn.a (emf32noslfn) to be more compatible with my PC.
I hope that this can work for your case, too.
Some additional note, off my head.
Since the I/O voltage of CY8CKIT-059 is 5V, the CS pin is around 5V when it is not asserted.
So IMHO, measuring 4.7V won't be a problem.
(I did not provide an external 3.3V, and let the 5V do all)
And even I renamed the media on my PC to SD,
the program reported "mmc:0:" so I took it as a spec of the linked library.
I just saw the schematic of your SD card IF, in your case the media detect SW is automatically on if you insert the media.
Are you testing your program with a media inserted?
(interesting enough, the program reported "mmc:0:" even without the media.)
Beside seeing the name "mmc:0:", is other part of you program working on you side of the planet?
Just to make sure, I downloaded your attachment and tried
I renamed the project to emFile_Example01_190806.
For the include path, I added 3 relative paths
For the Linker Configuration
And for the Library Directories
Having done above, I have not touched any other part of the project
and the program could be built and run.
I'm using a SD card reader from the link below. (Sorry Japanese)
So my conclusion is that the project is fine,
if it does not working probably problem is SD card reader hardware
or connection with it.
Thank you for taking so much time to help me !
I tried adding the third relative path but it didn't change anything.
It's a relief that the code is working then, but bad news that this might be hardware problem. I looked and there is no equivalent for the media detect in my SD card reader. I measured the voltage to the CD pin and it detects well my sd card. I will try again with FAT32 then and I'll see.
I think that what might be wrong is that the SD card is a 3.3V power supply ONLY.
Even though it is powered with 3.3V and only the SPI pins are in 5V then, it could probably be a problem so I'll try to supply the PSoC with 3.3V power supply and see what happens.
I also could try with another SD card but I don't think that I have another card under 2Go capacity.
If it does not work I'll probably try to reach the support team of Mikroe for their device.
I'll keep you updated.
I've tried both Geoffrey's and your projects. I get the same result that Geoffrey sees. Basically none of the SPI pins are toggling. It appears that although both yours and his project builds, the IO is not being controlled by the emFile component.
I tried to draw schematics for both my system and yours
First my system (working)
Second your system (the upper right part may not be accurate)
I think that most significant difference is the pin (10) of SD card holder.
I think that the pin must be LOW when there is a SD card inserted.
Meantime, I think that you can connect VDD(5.0V) of CY8CKIT-059 to the VCC/+3.3V of the SD Module
as far as you are not mounting the module to other 3.3V board.
Please try the following connections
VDD(5V) +3V3 (when the module is not connected to other 3.3V system)
P.S. I attached the binary files of my project, which is working on my side of the planet
bin_files.zip 148.5 K
My SD card interface doesn't not have a Card Detect input or output. This is a Seeedstudio V3.0 SD card reader. It was designed for an Arduino system that I have gotten to work successfully. It only has four signals (CS, SCK, SDI and SDO) along with VDD and GND.
The other issue is that when monitoring all 4 signals I observe no signal toggling when the SW should be reading our writing to the SD card.
In the beginning of this topic it was written
- microSD click from Mikroe
So I was trying to think about Mikroe SD module...
Are you with Gejo-san? or are we talking about two different systems at once here?
Anyway, since it's already 2:00AM in Japan, I'll take a look at Seeedstudio module tomorrow (or shall we call it today?).
Meantime, could you test this?
(1) Create a simple project
(2) add a GPIO pin (output, strong drive) without hardware connection
(3) Assign that pin to one of the pin used for SPI
(4) From a program repeat write(0) and CyDelay(500) and Write(1) and CyDelay(500)
(5) probe the pin and monitor it with you oscilloscope
if it is flipping you board should be OK,
but if not, may be your board has been damaged somehow.
I believe I solved both yours and my problem.
Your main() left out the
CyGlobalIntEnable; /* Enable global interrupts. */
Once I inserted it early in the initialization, my SPI communication lines to the SD begin working.
Note: I'm still having difficulty formatting and other FS functions but I can see the SPI is working now.
Does anyone have access to the FS API calls? [Update] Never mind. Found it!
Thank you for your response. I've gotten the SPI comm working now. The CyGlobalIntEnable; /* Enable global interrupts. */ was left out of Geoffrey's original project.
I am having FS problems. If you have access the the FS API calls, that would be handy. [Update] Never mind. Found it!
I have just seen the circuit of seeed sd shield.
You need to provide 5v to arduino 5v pin.
Have you connected the VDD/5V of cy8ckit-059 to the 5v pin of the shield?