I plan to play with 4-bit SDIO mode sometime in the future for SdFat.
Any progress with this?
I'm designing a Due clone at present and wondering if I should incorporate the HSMCI interface to an SD socket.
Rob
I plan to play with 4-bit SDIO mode sometime in the future for SdFat.
Any progress with this?
I'm designing a Due clone at present and wondering if I should incorporate the HSMCI interface to an SD socket.
Rob
It is unlikely that SdFat will support 4-bit SDIO on SAM3X since it won't work on Due.
I am reconsidering support for non Arduino boards. I can't test unless I have a board and it's a lot of labor for a few users.
I have been playing with SDIO on STM32F4 for my own RTOS use. SDIO provides super performance but you need large transfers with a lot of buffer.
I would be interested to know what Arduino applications would require more than a few MB/sec of I/O to an SD card.
I can't test unless I have a board and it's a lot of labor for a few users.
I understand, maybe I can bribe you with some hardware when the time comes
As for the number of users, that's in the lap of the Gods.
SDIO provides super performance but you need large transfers with a lot of buffer.
External RAM is supported, so buffer space should not be a problem.
I would be interested to know what Arduino applications would require more than a few MB/sec of I/O to an SD card.
That's probably the $64 question. I'm hoping to also have I2S support so maybe audio apps that analyse sound, a DSO that saves the waveform, logic analyser.
I guess I'm working on the "if you build it they will come" model, but they may not.
Rob
I wouldn't do anything to prevent use of HSMCI. I was very disappointed with Due.
All of these sound great:
I'm hoping to also have I2S support so maybe audio apps that analyse sound, a DSO that saves the waveform, logic analyser.
I would like to experiment with the new system. But I am in the dark how you hook up an Arduino Due with an Sd card shield (I have a SEEED Studio SD card shield v 3.1). Could you please give me some details on how you do that?
Kindest Regards,
MJM
How about a link to that shield?
In lieu of one I assume it uses SPI so you would connect it to the SPI pins and a CS pin of your choice on the Due.
One possible problem is that it may be designed for a 5v host and level shift the voltages, this may or may not work well with a 3v3 host.
Once again more information (and a schematic) of the shield would help.
Rob
The web site with only a description (no schematic) is http://www.seeedstudio.com/depot/sd-card-shield-p-492.html
There is no description of the connectors to this SD shield. It seems to me that a 6 pin connector on the arduino due (next to the processor chip) needs to be connected to the connectors on the SD shield. I don't know the name of these and at the store they couldn't help. The 5V vs 3.3 V problem you mention could be solved with a jumper from the Due to the SD shield. Any ideas on the connectors and how to connect them?
MJM
The first thing I see on that page is
Arduino and Seeeduino compatible ( Do not compatible with Mega)
That might be a problem
But without a schematic or some real information I don't know what to suggest except map out the schematic yourself from the PCB or buy a board from someone who does provide proper documentation.
Rob
Thanks, That is probably wise councel.
Kindest Regards,
MJM
There's an issue when SdFat and the VGA library are used together (see VGA library - now with TV output - #21 by system - Arduino Due - Arduino Forum)
I've been looking into this and the problem seems to be down to an SPI overrun. The VGA library is quite a DMA hog, and what appears to happen is that in spiRec() the TX DMA sends data faster than the RX DMA can write it to memory due to the bus contention.
Looking at the data sheet, the SPI_MR register has a flag SPI_MR_WDRBT which should hold up the TX DMA until the RX DMA has read the SPI_RDR register. I'm experimenting with the following fix:
in Sd2Card.cpp, in spiRec() around line 234
after this line: #if USE_SAM3X_DMAC
add this line: pSpi->SPI_MR |= SPI_MR_WDRBT;
in spiSend() around line 268
after this line: #if USE_SAM3X_DMAC
add this line: pSpi->SPI_MR &=~ SPI_MR_WDRBT;
The idea is that in spiRec() the SPI_MR_WDRBT flag helps keep the two DMA channels in sync, but spiSend needs the flag turned off again otherwise it will hang.
I have not given this fix much testing other than running bench and QuickStart, and a modified QuickStart which outputs to VGA, which all work correctly.
I am rearranging SPI into files for each processor so I will add the SPI_MR_WDRBT fix to SAM3X.
I will soon post this in an SdFat beta.
Hi
I followed that thread but i cant get it to work.
I am using Breakout Board for SD-MMC Cards: https://www.sparkfun.com/products/11403
I am confused about the pin connection.
what i did so far i connected:
D0 ===> MISO (ICSP-1)
CLK ===> SCK (ICSP-3)
CMD ===> MOSI (ICSP-4)
D3 ===> PIN 10
GND ===> GND
VCC ===> 3.3V
the rest of the ICSP pins are not connected
can anyone help me with schematic for this break board connection to the DUE?
I did tests with the SPI_MR_WDRBT bit set on SPI receive.
I used a 1 GB ATP industrial grade SD card which has SLC flash.
Setting the bit slows read a lot.
Here are results of bench with SPI_MR_WDRBT set in receive:
Free RAM: 79135
Type is FAT16
File size 10MB
Buffer size 16384 bytes
Starting write test. Please wait up to a minute
Write 3833.62 KB/sec
Maximum latency: 65578 usec, Minimum Latency: 3866 usec, Avg Latency: 4265 usecStarting read test. Please wait up to a minute
Read 2993.18 KB/sec
Maximum latency: 5752 usec, Minimum Latency: 5457 usec, Avg Latency: 5472 usec
Here are the results with SPI_MR_WDRBT clear in receive.
Free RAM: 79135
Type is FAT16
File size 10MB
Buffer size 16384 bytes
Starting write test. Please wait up to a minute
Write 3832.15 KB/sec
Maximum latency: 65958 usec, Minimum Latency: 3864 usec, Avg Latency: 4267 usecStarting read test. Please wait up to a minute
Read 4391.14 KB/sec
Maximum latency: 3956 usec, Minimum Latency: 3715 usec, Avg Latency: 3730 usec
Read is about 1,400 KB/sec slower with the bit set so I don't think I can justify setting the bit as the default.
Yes that's too much of a compromise I've been experimenting with other flags and DMA settings and I can't get the lost speed back.
Also after modifying the bench example to output to the VGA library, it turns out that setting SPI_MR_WDRBT is slower than disabling DMA (#define USE_SAM3X_DMAC 0) when using both libraries together. There is no way I can find of getting the two libraries to share DMA without either SdFat going too slow or getting SPI underruns, or the VGA library getting visual glitches. Disabling DMA in SdFat is faster by about 50% (800KB/s v 1200KB/s) with no glitching.
NOOB ALERT
Hi,
Don't mind me asking this NOOBY question, but how do i connect my Arduino Due --> SD Card Shield?
Can i got the proper pin number and if req., any resistors?
Thanks for your help.
--
Rohin
Hello everyone,
I am trying to get this library functioning on the Arduino DUE with this LCD: http://imall.iteadstudio.com/im120419004.html and a custom shield. Everything is working fine on the MEGA.
As there is the option to use Software SPI (USE_SOFTWARE_SPI) I tried this because I have no option to connect to the SPI port on the DUE. But it is not working.
All I get is this:
Can't access SD card. Do not reformat.
No card, wrong chip select pin, or SPI problem?
SD errorCode: 0X1,0XFF
Here are my used pis (same as Arduino MEGA SPI):
SOFT_SPI_CS_PIN = 6
OFT_SPI_MOSI_PIN = 51
SOFT_SPI_MISO_PIN = 50
SOFT_SPI_SCK_PIN = 52
Does anyone has a tip for me? Speed is not important for me as I just want to save some configurations and settings.
Thanks,
A.
fat16lib:
I wouldn't do anything to prevent use of HSMCI. I was very disappointed with Due.
All of these sound great:
I know it's an older comment. Could you elaborate on what disappoints you specifically with DUE?
I have a custom made Arduino Due board with an SD shield attached to SPI( MOSI - Digital pin 75, MISO Digital pin 74, SCK, Digital pin76 and SS - Digital pin 4). I'd like to be able to log data to the SD as fast as possible, I have about 12KB/s of sensor data that I need to log. The sensors are samples at about 200Hz and provide about 50 bytes of data every sample.
I tried the Arduino SD lib but I found it too slow. I switched over to the SDFat lib but cannot get arduino to see the SD card. The SD library saw it just fine. My code as well as the example bench.ino seems to get stuck at the "if (!sd.begin(4, SPI_EIGHTH_SPEED)) sd.initErrorHalt();", no matter what speed I select. What am I doing wrong? Do I need to change my SPI pin settings somewhere in the SDFat lib code?
Please help....
Frank
Hi Everyone,
I also want to work the SdFat library. I´m using an Arduino Due and adafruits SD breakout shield.
I started the bench.ino and made the following changes:
#define FILE_SIZE_MB 20
#define FILE_SIZE (1000000UL*FILE_SIZE_MB)
#define BUF_SIZE 32768
I also use Pin 10 for the ChipSelect.
I have a 2GB Transcend SD which is FAT32 formatted.
This is what I got with SPI_FULL_SPEED:
Use a freshly formatted SD for best performance.
Type any character to start
Free RAM: 62751
Invalid format, reformat SD.
With SPI_HALF_SPEED I get:
Use a freshly formatted SD for best performance.
Type any character to start
Free RAM: 62751
Type is FAT32
File size 20MB
Buffer size 32768 bytes
Starting write test. Please wait up to a minute
Write 1669.18 KB/sec
Maximum latency: 99601 usec, Minimum Latency: 16203 usec, Avg Latency: 19624 usec
Starting read test. Please wait up to a minute
Read 2315.89 KB/sec
Maximum latency: 14924 usec, Minimum Latency: 14013 usec, Avg Latency: 14147 usec
Done
Is there a reason, why I can`t run on FULL_SPEED?
Or has anybody a tip how to get a better performance?
Thank you!
rob91:
Is there a reason, why I can`t run on FULL_SPEED?
Or has anybody a tip how to get a better performance?
Hi Rob,
There is a possibility that your SD shield uses resistor level shifters, this appears to be the biggest stumbling block preventing successful use of SPI_FULL_SPEED, however, there is also the possibility that the SD card you are using might not be up to it?
I have a Fujifilm Class 4 SDHC 8GB card, and also a SanDisk Class 4 Micro SDHC 4GB card, both of which work successfully with the ColdTears(CTE) TFT/SD/TOUCH Shield.
For your own reference using your figures, 50MB file, 32768 buffer size, I get the following speeds :-
Fuji 8GB
Write 3100KB - 3320KB Read 3887KB - 3905KB
SanDisk 4GB
Write 3452KB - 3628KB Read 4320KB - 4338KB
I have a further point I would like to mention which although is not directly related to the sdfat library, I did notice the differences when running the sdfatlib benchmarks.
When compiled on IDE 1.5.4 the bytes written to flash was 22340 with #include <SPI.h> 22456
When compiled on IDE 1.5.5 the bytes written to flash was 22492 with #include <SPI.h> 22616
Furthermore, without the SPI library, free RAM is 62751 for V1.5.4 and 62751 for V1.5.5
however, with the SPI library, free RAM is 62703 for V1.5.4 but only 62699 for V1.5.5
The use of #include <SPI.h> in the above tests, did not demonstrate any noticeable differences in performance.
Conclusion :- V1.5.4 produces a smaller flash image and uses less RAM in certain cases, I no longer have older IDE's to continue this testing, has anyone else noticed any similar differences?
Regards,
Graham