RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Mar 29, 2020 10:28 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Nov 28, 2015 2:09 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
SD driver in LiteBSD has been enhanced to support high-speed mode. Thanks Pito for the research and prototype implementation. Most modern SD cards support this feature: a Switch Function command (CMD6) that allows to increase the clock rate from 12.5MHz to 25MHz.

Now at kernel startup, when a high-speed capable card is detected, a following message is printed:
Code:
sd0: function groups 3/1/1/1/1/1, max current 100 mA
sd0: type II, size 247808 kbytes, speed 25 Mbit/sec

As you can see, a speed has been increased to 25MHz (default is 12.5MHz). Most cards also tell the max current they need from the power supply - 100mA in this case. A bit mask of supported modes is also printed for six available function groups (see SD spec for details).

Here is a table of data transfer rates I've collected for a few different types of high-speed SD cards:
Code:
Manufacturer          Volume  Current Write speed Read speed  Scan time
-----------------------------------------------------------------------
Kodak                   4GB   100mA    837kB/sec  2312kB/sec   9.1sec
Adata                   2GB   100mA   1044kB/sec  2325kB/sec   8.9sec
Noname                  2GB   100mA   1083kB/sec  2322kB/sec  12.7sec
Lexar                  16GB   200mA   1191kB/sec  2214kB/sec   9.2sec
Samsung (blue)          8GB   200mA   1429kB/sec  2182kB/sec   7.3sec
Samsung EVO (yellow)   16GB   200mA   1596kB/sec  2165kB/sec   9.2sec
Delkin Devices        256MB   100mA   1726kB/sec  1960kB/sec   8.9sec

Write/read speed data has been collected using diskspeed utility; file scan time measured by command "time ls -lR / > /dev/null".


Top
 Profile  
 
PostPosted: Sat Nov 28, 2015 11:06 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The high speed mode is up to 50MHz with 3.3V signaling (at least with CL10 UHS-I cards), and I run SPI at 50MHz with LiteBSD (with my hack).
RD/WR speed with Sams. Evo 8GB CL10 UHS-I has been 3421/2196 [kB/sec].
http://retrobsd.org/viewtopic.php?f=5&t=37313#p42452

Code:
SDR12 = single data rate up to 12.5MB/sec, 25MHz clock, 3.3V
SDR25 = single data rate up to 25MB/sec, 50MHz clock, 3.3V, 1.8V
SDR50 = single data rate up to 50MB/sec, 100MHz clock, 1.8V
SDR104 = single data rate up to 104MB/sec, 208MHz clock, 1.8V
etc.


Above is with SDIO interface and UHS-I, the electrical parameters are the same with SPI.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Nov 30, 2015 9:57 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
It's a matter of further research: how to identify UHS cards in the driver and reliably switch them to 50MHz clock.


Top
 Profile  
 
PostPosted: Wed Dec 02, 2015 9:08 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Attachment:
uhs types.JPG
uhs types.JPG [ 79.27 KiB | Viewed 6263 times ]


As the pic32mx and pic32mz do not support 1.8V signaling and do not support 4bit SDIO interface, the identification of an HSpeed capable card - "CL10" or "UHS-I" - is simple afaik:

the group 1 indicates the HSpeed mode (returns "3" or bigger).

The driver strength and power settings and higher speeds are applicable to SDIO and 1.8V signaling only.
There is no special need for different initialization exercise with our setup as it is done today.

Based on group1 value I would simply add "HS" to the card information - ie. "SDHC(HS)"

Mind the HS mode is up to 50MHz SPI speed - so you have to think about when wiring the SDcard. The fubarino SD and SDZL boards are well prepared as the wiring is short. I do not posses other commercial boards, so I do not know how the others are designed.

When working w/ DIY board I would recommend as short as possible wire lengths, good grounding, good decoupling, etc. Fortunately, we use 3.3V signaling - so no need for various obscure "level shifters" here..

_________________
Pukao Hats Cleaning Services Ltd.


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