Hi,
Here what I use in this project :
My code compile without error,
But in the end, it just does nothing, and it seems that it doesn't even see the sd card. It only displays a generic name "mmc:0" which is why I changed the SD card name to "UMTS" to be sure it was not working.
Here I link the schematics for my SD card Reader : https://download.mikroe.com/documents/add-on-boards/click/microsd/microsd-click-schematic.pdf
And all the information : https://www.mikroe.com/microsd-click
Intersting fact that might be a lead : I measured voltage with a voltmeter (DC mode) and I couldn't measure anything except for CS pin
Solved! Go to Solution.
Geoffrey,
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!
Len
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 ?
Geoffrey,
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...
Len
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.
Hi,
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.
moto
Hi,
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?
moto
Hi,
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)
マイクロSDカードスロットDIP化キット: 組立キット 秋月電子通商-電子部品・ネット通販
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.
moto
Hi Moto,
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.
Geoffrey,
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!
Len
Moto,
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.
Len
Dear Len-san,
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
====================
CY8CKIT-059 micorSD
P12[0] CS#
P12[3] SDI
P12[4] SCK
P12[2] SDO
GND CD#
VDD(5V) +3V3 (when the module is not connected to other 3.3V system)
GND GND
====================
Best Regards,
7-Aug-2019
Motoo Tanaka
P.S. I attached the binary files of my project, which is working on my side of the planet
Moto-san,
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.
Len
Dear Len-san,
In the beginning of this topic it was written
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)
while(1) {
the_pin_Write(0) ;
CyDelay(500) ;
the_pin_Write(1) ;
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.
Best Regards
8-Aug-2019
Motoo Tanaka
Moto-san,
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!
Len
Dear Len-san,
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?
Best Regards
8-Aug-2019
Motoo Tanaka
Moto-san,
Yes. 5V is connected. I'm having difficulties with the FS calls. Something's not right.
Len
Dear Len-san,
(1) Could you be more specific about the "difficulties"?
(2) Please let me know the connection between the Seeed Shield and CY8CKIT-059
(3) Make sure that the card selector switch is micro SD position
(4) This needs to be at your own risk,
but try connecting CDN pin of SD Card Reader to GND
Note: My case it worked, I can not guarantee if it works for you, though.
Best Regards,
8-Aug-2019
Motoo Tanaka
Moto-san,
Thank you for your time and research. I have solved the problem. The switch that seleted between the standard SD card or the mini SD was set to mini and I was using standard SD cards. Once I flipped the switch to "standard" I could talk to the formatted SD card.
Len
Dear Len-san,
LOL.
But I'm glad knowing that you are OK now 😉
Best Regards,
9-Aug-2019
Motoo Tanaka
Moto-san and Geoffrey,
If you're interested. I've modified Geoffrey's original project to be menu driven commands as well as using the CY8CKIT-059's USB port for UART comm instead of the KitProg.
I've attached the project here.
You will need to do the following:
I plan to add more commands to the program. You can add more commands if you're interested. Sorry the comments are a little 'lite'.
Enjoy!
Len