RetroBSD

2.11BSD operating system for microcontrollers
It is currently Mon Dec 09, 2019 1:24 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ] 
Author Message
PostPosted: Mon Aug 22, 2011 8:20 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
These cards are known to work, @ following SPI clock speed:
----------------------------------------------------------------------
1) NCP SD 256Mb - type 1, SPI 13.3MHz
2) Patriot SD 2Gb - type 2, SPI 13.3MHz
3) Wintec micro SD 2Gb - type 2, SPI 13.3MHZ
4) Transcend SDHC 4Gb - type 3, SPI 13.3MHz
5) Verbatim SD 2Gb - type 2, SPI 13.3MHz
6) Kingston micro SD 512Mb - class 1, SPI 20MHz
7) Kingston micro SDHC 4Gb - class 4, SPI 20MHz
8) Apacer micro SDHC 4Gb - class 4, SPI 20MHz
9) Sandisk micro SDHC 4Gb - class 4, SPI 20MHz

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Aug 25, 2011 1:12 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
10) Kingston micro SD 512Mb - class 1, SPI 24MHz

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sat Aug 27, 2011 6:22 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
I measured a write speed of several different SD cards, on kernel r269 and SPI 13.3 MHZ, using command:

# time dd bs=4k if=/dev/zero of=zzz count=1024

Results:
1) NCP SD 256 Mb - 440 kbytes/sec
2) Wintec microSD 2 Gb - 260 kbytes/sec
3) Sandisk SDHC 4 Gb - 198 kbytes/sec
4) Transcend SDHC 4Gb - 180 kbytes/sec
5) Patriot SD 2Gb - 145 kbytes/sec
6) Kingston microSDHC 4Gb - 55 kbytes/sec

_________________
--Serge


Top
 Profile  
 
PostPosted: Sat Aug 27, 2011 3:32 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Interestingly, my Kingston microSDHC 4Gb (@13.3MHz spi, r269) shows:
# time dd bs=4k count=1024 if=/dev/zero of=zzz
20.1 real 0.0 user 19.7 sys
So when :
write_speed= (bs*count)/sys= 208kB/sec
p.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Aug 28, 2011 11:03 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
I changed sd driver to use write-multiple operations, and tested on several types of cards. Not committed yet - first need to fix virtualmips to support new SD commands.

_________________
--Serge


Top
 Profile  
 
PostPosted: Tue Aug 30, 2011 6:53 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
r287 (new sd driver) - Kingston uSDHC 512MB, SPI @20MHz:
# time dd bs=4k count=1024 if=/dev/zero of=yyy
15.6 real 0.0 user 15.1 sys
# time dd bs=8k if=yyy of=/dev/null
512+0 records in
512+0 records out
4.3 real 0.0 user 3.8 sys
#
this leads to write 271kB/sec (+31) and read 1078kB/sec (+398). Cool!

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Aug 30, 2011 8:45 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Pito,
Try r288: it should be twice faster on write.
---Serge

_________________
--Serge


Top
 Profile  
 
PostPosted: Tue Aug 30, 2011 2:44 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi Serge, r288, Kingston uSDHC 512MB, SPI @20MHz:
# time dd bs=1k count=4096 if=/dev/zero of=zzz
4096+0 records in
4096+0 records out
13.8 real 0.0 user 13.1 sys
# time dd bs=8k if=zzz of=/dev/null
512+0 records in
512+0 records out
4.6 real 0.0 user 3.8 sys
# time dd bs=4k count=1024 if=/dev/zero of=zzz
1024+0 records in
1024+0 records out
14.0 real 0.0 user 13.1 sys
# time dd bs=8k count=512 if=/dev/zero of=yyy
11.5 real 0.0 user 10.5 sys
# time dd bs=16k count=256 if=/dev/zero of=xxx
10.8 real 0.0 user 10.4 sys
# time dd bs=16k if=xxx of=/dev/null
256+0 records in
256+0 records out
4.6 real 0.0 user 3.7 sys
#

Max Write 394kB/sec, Max Read 1107kB/sec! Great improvement, thanks!
p.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Aug 31, 2011 11:49 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
New data, using 32-bit SPI mode (thanks Pito!).


_________________
--Serge


Top
 Profile  
 
PostPosted: Wed Aug 31, 2011 12:08 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi Serge, I thought the 32bit spi sector xfer will have bigger impact, however there is an improvement seen:
Kingston, uSD, 512MB, SPI@20MHz
# time dd bs=4k count=1024 if=/dev/zero of=yyy
10.1 real 0.0 user 9.7 sys
# time dd bs=4k if=yyy of=/dev/null
1024+0 records in
1024+0 records out
3.5 real 0.0 user 3.0 sys
#
This leads to max write 422kB/sec and max read 1365kB/sec.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Sep 01, 2011 4:53 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Pito,
Try r291 - with read-multiple ops, reading speed improved by 50%!
--Serge


_________________
--Serge


Top
 Profile  
 
PostPosted: Thu Sep 01, 2011 6:20 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi Serge, this is with r293 and with simple spi enhanced buffering, Kingston uSD 512MB @20MHz SPI, mind 8MB zzz:
# time dd bs=4k count=2048 if=/dev/zero of=zzz
19.8 real 0.0 user 18.7 sys
# time dd bs=8k if=zzz of=/dev/null
1024+0 records in
1024+0 records out
5.6 real 0.0 user 4.9 sys
#
Read 1672kB/sec, Write 438kB/sec.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Sep 01, 2011 10:54 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Cool! What is the CPU frequency?

_________________
--Serge


Top
 Profile  
 
PostPosted: Fri Sep 02, 2011 1:52 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
default 80/80

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Fri Sep 02, 2011 8:58 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Great: your SD card is very fast on read. Does SPI fifo really help?

_________________
--Serge


Top
 Profile  
 
PostPosted: Fri Sep 02, 2011 3:55 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Yes, this single card is quite fast.. All others much slower.. The FIFO buffering helps a little (see my post in Drivers). Maybe the buffering can be pipelined somehow - so we do tx while we reading from buffer. This would require more complexity in the algorithm however.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 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:




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission