RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Jul 18, 2019 2:29 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: SD card benchmark
PostPosted: Sun Feb 15, 2015 8:07 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Not all SD cards are good for RetroBSD. I've created a simple utility 'diskspeed', to be able to quickly obtain some metrics for comparison. When invoked without arguments, the utility writes 8 Mbytes of data to a temporary file (using 4-kbyte blocks), then reads the data back. Write and read data rates are printed. File size and block size can be varied using command line options.

I tested all of my SD and microSD cards, using Fubarino SD, Maximite and WiFire boards. Here you can find the results: http://retrobsd.org/wiki/doku.php/doc/sd-benchmark

Diskspeed measures the sustained data rate, but not the latency. So I added two other tests:
Code:
# time sh -c 'for i in /sbin/*; do date; done'
This shell script measures how fast the shell can launch commands. Works fine for RetroBSD.

Code:
# time ls -lR /
This command measures how long does it take to list all the files in filesystem. Good for LiteBSD.

The best card, from my experience, is the one which has a minimal time of shell test or file list test, and good writing speed.

You are welcome to add your own data. All the forum members are allowed to edit and create Wiki pages.


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 9:17 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Serge, a nice sdcard collection :)
I think the first test includes writing latency. The writing latency is always there during a write. Therefore the differences. The wr latency could be up to 250ms, usually 5-50ms and it hits anytime and quite often (many times per second of sustained write). There is a graph I did long time back measuring wr latency, see 'writing latency'.
Also the filesystem list test result depends on the filesystem content, I would say.. ;)
Btw, what is the max stable spi clock with Lite and your cards?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 1:57 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Serge and Pito,

Nice work :). IIRC there is a 4 bit SD interface as well?

I wonder if it would be faster?

Maybe someday we can test such a driver if anyone knows how to use it?

It might make the swap to SD operation much faster?

Wiz


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 2:46 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
The 4 bit SD interface, while theoretically faster would actually be slower for us since the PIC32 lacks hardware support for it.

The current SD driver uses the hardware SPI port which is considerably faster than bitbanging a four bit interface.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 3:35 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Matt,

Really ??

I have 1 bit code running for my RF project so I can use that.

Do you have any 4 bit code I can play with?

At least with PIC16, assembly i/o is about twice as fast as hardware i/o.

So I think it is worth some more study.

Lots of snow and cold here ( NH USA ) !!

Lots of fun :)

Wiz


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 3:45 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
We use advanced buffering and all sorts which makes the transfer much smoother and efficient. You can't do that with bit banging. Also we are considering DMA for transfers on LiteBSD which really rules out bit banging.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 6:51 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The ramdisk uses 8bit PMP access, moreover an "serial" one (the protocol is the same as with serial srams, but w/ 8bits in parallel). The speeds I get with 80MHz retrobsd is ~3.5MBytes/sec (75ns psram).

An SDIO would be great to have with MZ, you can get 20-25MBytes/sec (at 200MHz clock) then.
Unfortunately there is none.. :?

Btw - shell test (fubarino stock) with swap on ramdisk:
Code:
# time sh -c 'for i in /sbin/*; do date; done'
..
Sun Feb 15 11:17:58 PST 2015
        1.9 real         0.0 user         1.4 sys
#

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 7:16 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
I'm wondering if the MZ's SQI interface could be used for SDIO...?

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 7:31 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
SDIO is more than an hw interface, I think..
SQI is just SPIx4..
BTW the vendors have to pay license fee for SDIO, therefore none on MZ :)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 7:36 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
SDIO has 4 data, one clock, and one "command response" pin. SQI has 4 data, one clock. The "command response" pin can be just a GPIO.

I don't know what the protocol that runs on it is though, but I'm sure there's a way we could use SQI to emulate 4-bit SDIO.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Sun Feb 15, 2015 7:53 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
http://www.quicklogic.com/assets/pdf/da ... -Sheet.pdf
http://www.nxp.com/documents/data_sheet/SDIO101A.pdf

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
 Post subject: Re: SD card benchmark
PostPosted: Tue Feb 17, 2015 3:30 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi All,

Pito: thanks for the docs.

It appears (to me) that SDIO is 'probably' much faster even if bitbanged? This could be real advantage for swapping to SD.

One real advantage of bitbanged I/O is that many fault conditions are much easier to detect and recover from than when MFGRs hardware and drivers are used. There is also that particularly nasty problem of bringing all leads including power to ground to restart the SD card. I wonder IF RetroBSD can even provide that sort of restart at all? Quite a lot of things have to be correctly restarted.

Perhaps some of the embedded Linux dists have an SDIO driver that could be used as a starting point? OpenWRT or some other?

Failing that, a simple logic analyzer should spill the beans.

Lots of fun :).

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission