I'm using Realview 3.11, RL-ARM 3.10 and a LPC2129. Ican normally format, read, write and append files inside my system, but I found some problems trying to work with the SD Card files in the computer.
First I formatted my SD Card (128MB) using fformat() and create a file using fopen(). The following problems ocurred when I tried to edit the file in the computer
- If I delete a file the file remains listed, but now it's corrupted.
- If I edit a file using e.g. Notepad, the file size is not altered, which means that nothing I append to the end of the file will be considered and if I add something in the middle, it cuts the number of characters added in the end of the file.
After I formatted the SD Card in Windows, selecting FAT format. It worked fine in my system, except that fcheck() return an error, but you can normally open and edit files in both systems
Can you perform the following test:
1. Format SD Card in your system with fformat(). 2. create a file on SD Card in your system 3. check the SD Card file system consistency in Windows from the command prompt with: chkdsk
Post the problems detected by this utility.
Thank you.
It didn't report any error and somehow, the system now works fine. Maybe checkdisk fixed something without warning...I will make much more tests with my system, because I really need it reliable. In case a find something I'll post here...Thanks
My feeling is that this problem might have something to do with the SPI speed.
Try reducing the SPI hi-speed rate in the SPI driver if the problem persists. Also check your system clock settings.
Hallo!
Check capacitor nominal value between SD's VSS 3.3V and GND. Should be in accordance with SD specification, e.g. ~100 uF. I had really hard time working with SD and discovered later the capacitor was damaged. Each time I had access to read procedures it was OK but write/erase-related functions did not work or were glitchy.
Regards, Nikolay.
Oops, please disregard VSS mentioning. The SD capacitor is between 3.3V and ground.
Nikolay.
You may want to see this section:
Consideration to Bus Floating and Hot Insertion
here: elm-chan.org/.../mmc_e.html
If the driver is written properly, there is no reason to slow down the SCLK. I've used MMC+ with 48 MHz SCLK without any problems. With SCLK=24 MHz, 2.4 MBytes/sec for reads, and max 2.1 MBytes/sec for the writes is possible (SD).
If the driver is written properly, but the hardware isn't within specification, even a perfect driver may need the frequency to be lowered.
Then it is not a perfect driver if it allows the hardware to be operating outside of the HW specifications, ne pas? :-)
No, a perfectly written driver would just has to assume that the bus loading, the supply voltages etc are correct as specified in the standard. It is impossible for the driver to measure slew rate on the data signals, or to know about any jitter on the supply voltage.
Since the driver can't know such things, it is meaningful to try to reduce the transfer speed and check if that affects the function. If the speed matters, it is time to figure out if the speed decrease was needed because the driver was badly written, or because the memory card was bad or the hardware signals and/or supply voltages requires some redesign work.