|
Post by lukint on Apr 5, 2018 13:38:50 GMT
Hi all, after a few days of testing, I achieved a great writing speed with SdFat library, so I want to tell you how to do this. First you have to do this, like admin posted before (many thanks for your support):
Then enable the SdFatSoftSpiEX class in SdFatConfig.h, initialize your sd object with SdFatSoftSpiEX<61, 63, 62> sd; // that are the MISO, MOSI and SCK pins on P201 Afterwards you can do sd.begin(SD_CS_PIN, SD_SCK_MHZ(40)) So I achieve 981KB/sec writing speed in a simple bench test with an 16GB MicroSDHC card. I think this is pretty fast! I am very happy with this, because now my project is working like it should do.
|
|
|
Post by Admin on Apr 5, 2018 15:17:03 GMT
Thanks - good information!
|
|
|
Post by lukint on Apr 11, 2018 9:25:07 GMT
|
|
|
Post by autogeek on Apr 26, 2018 11:37:34 GMT
Do you have sample ino files to run this?
|
|
|
Post by lukint on May 2, 2018 6:38:47 GMT
Of course. Here is the example SDBench from SdFat library with the little changes I have done. It's not an .ino file because I'm working with Eclipse only. SDBench.cpp (6.19 KB)
|
|
|
Post by wphrwm on May 10, 2018 20:02:46 GMT
I have been trying to get an ADAfruit Display/SD card board operating
I have not succeeded in getting the SD Card using Pins 13,11,10 on the ShieldBuddy despite the fact that the display works fine on these pins. I have tried all the fixes suggested on the Web to no effect.
I then read this thread on "Fast SD" and realised that the SD software seems to use the SPI pins on the P201 connector using the guidance above was able to get a stand-alone ADAfruit SD Breakout Board working.
I am using the Arduino/VB IDEs but this strategy would probably work also with the Eclipse IDE
What to do: Just connect the board to Pins 61, 63. & 62 // that are the MISO, MOSI and SCK pins on P201.I used Pin 4 as the card select pin and bingo!
|
|
|
Post by Admin on May 11, 2018 7:03:10 GMT
Cool!
|
|
|
Post by lukint on May 17, 2018 12:49:34 GMT
I've tested to change the SPI pins to other digital pins and it's working very well. So you can use every digital pin you want as MISO, MOSI, Clock and CS. I only want to tell you cause you can use more other shield easier if the pins P201 are free. You only have to change the pin numbers in the SoftwareSpiEX Class at the beginning of your program. Have fun!
|
|
|
Post by arthur on Mar 11, 2019 8:59:15 GMT
Can you tell me please why there's no difference for speeds (1MHZ, 10MHZ and 40MHZ) ?
SdFatSoftSpiEX<61, 63, 62> sd; SPEED 40 ----------------------------------------------------- 08:54:38.423 -> FreeStack: 0 08:54:38.457 -> Type is FAT32 08:54:38.457 -> Card size: 31.71 GB (GB = 1E9 bytes) 08:54:38.627 -> File size 5 MB 08:54:38.662 -> Buffer size 512 bytes 08:54:38.731 -> write speed and latency 08:54:38.766 -> speed,max,min,avg 08:54:38.766 -> KB/Sec,usec,usec,usec 08:54:43.773 -> 1004.96,10430,505,508 08:54:48.767 -> 1004.56,10496,505,508
08:54:48.836 -> read speed and latency 08:54:48.870 -> speed,max,min,avg 08:54:48.870 -> KB/Sec,usec,usec,usec 08:54:57.125 -> 609.35,2441,839,840 08:55:05.327 -> 609.42,2440,839,840
SdFatSoftSpiEX<61, 63, 62> sd; SPEED 10 ---------------------------------------------------- 08:58:00.273 -> write speed and latency 08:58:00.308 -> speed,max,min,avg 08:58:00.308 -> KB/Sec,usec,usec,usec 08:58:05.315 -> 1003.95,10433,505,508 08:58:10.327 -> 1004.56,10522,505,508
08:58:10.395 -> read speed and latency 08:58:10.429 -> speed,max,min,avg 08:58:10.429 -> KB/Sec,usec,usec,usec 08:58:18.660 -> 609.35,2439,839,840 08:58:26.900 -> 609.42,2439,839,839
SdFatSoftSpiEX<61, 63, 62> sd; SPEED 1 --------------------------------------------------- 09:00:50.374 -> write speed and latency 09:00:50.408 -> speed,max,min,avg 09:00:50.442 -> KB/Sec,usec,usec,usec 09:00:55.411 -> 1003.95,10452,505,508 09:01:00.418 -> 1004.56,10516,505,508
09:01:00.486 -> read speed and latency 09:01:00.520 -> speed,max,min,avg 09:01:00.554 -> KB/Sec,usec,usec,usec 09:01:08.782 -> 609.35,2442,839,840 09:01:16.983 -> 609.42,2441,839,839
|
|
|
Post by deadman1966 on Oct 16, 2019 18:12:16 GMT
I have the D step version would i remove the sd library from the same file as shown in this thread. Could you show what line was removed from the platform.txt file. I am comparing your posted file to mine using notepad ++ and it seems that the line removed is part of a long line of test and not a line by itself in the file. Could you show the changes made to the sdfat config file to get SPI working. In my case i am on pins 50,51,52 with CS on pin 48.
|
|
|
Post by Admin on Oct 16, 2019 19:27:20 GMT
It is on our wish list to remove the SD card driver from the ShieldBuddy library. We are not sure which line lukint removed but it is likely to be this:
-I "{runtime.hardware.path}/aurix/libraries/SD/src"
It appears twice in platform.txt (and platform_Dx.txt).
|
|
|
Post by deadman1966 on Oct 18, 2019 2:36:26 GMT
Thanks i will remove it from both directories and give it a go with sdfat.
Would you know what files are involved with the Ethernet example i am looking for which files define the cs pin for the card. The card by default uses 10 for inet and 4 for sdcard but i have remapped those to other pins since the card is hardwired off board so its not sitting on top of the shieldbuddy.
Will try and get this example working on the sdcard on the Ethernet shield which i have on pin 47 for chip select instead of pin 4 if i plugged it on top.
|
|
|
Post by Admin on Oct 18, 2019 8:16:49 GMT
The W5100.cpp is where the Ethernet to SPI interface is located.
|
|
|
Post by Admin on Oct 18, 2019 11:34:32 GMT
|
|