RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Mar 31, 2020 2:50 am

All times are UTC




Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Dec 01, 2015 11:24 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Wiz, you may run your cards as you wish. There is no risk to be too close to the bleeding edge with introduction of the HS modes, as you can set any SPI frequency.
With
a) SPI_MHZ=something you can go as you did before,
b) with SPI_FAST_MHZ=something you may go as you did before, or, you can go close to the bleeding edge :)

So we do not introduce any instability here - High Speed mode sets the sdcard's inner, such it tells to the card "hey - you might be fed by a higher clock". But it must not be fed with a higher clock at all. You may run at 4MHz SPI (as I did in my "low-power" experiment) while the card has been switched over to HS.

The only issue you may encounter with HS is when you use some kind of a "level shifter" or a slow cmos logic buffers between SPI and the sdcard - when the card is in HS mode it could be more sensitive to the slow signal edges.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Dec 01, 2015 2:53 pm 
Contributor

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

You are perhaps right? Run as fast as the specs. say??

Your point about slow logic is certainly well taken. I suppose we could test for margins? With some sort of file system test facility?

If I recall your comments correctly? Some cards die and don't come back if operated at too high a speed? So that would make margin testing more difficult :).

The above comment alone would get me running the cards somewhat slower than their specs. And of course it would be nice to be able to cold boot a failed card to see what really happened.

There is also the issue of temperature [and humidity soak?] on the card's timing?

Right now the factory temperature is 44 F. So it is pretty cold. Some of my PIC32 prototypes have trouble starting their clocks. Once started though, they seem to run and keep running.

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Mon Dec 07, 2015 7:21 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Pito,

I finally solved a problem of identifying 50MHz-capable cards. See LiteBSD rev332 - now it automatically switches the card to 50MHz when possible. Here i compiled al list of test results for a few different types of microSD cards: https://github.com/sergev/LiteBSD/wiki/SD-Card-Benchmark.

--Serge


Top
 Profile  
 
PostPosted: Mon Dec 07, 2015 9:52 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi Serge, great results!!
So I was not too off in my PM to you a month ago:
Quote:
I guess your Lexar CL10 cards must be the winners, my guess is 2800/4000 wr/rd speeds.. 

.. at least with the read speed..
:geek: :P

PS: I would recommend to make this patches (from line 489):
Code:
    /* Read 64-byte status. */
    for (i=0; i<64; i++)
        status[i] = spi_transfer(io, 0xFF);
    // sd_deselect(io);    <<<<<< do not deselect here

Code:
    if ((status[16] & 0xF) == 1) {
        /* The SDcard is going to be switched into the high-speed mode. */   <<<<
        int khz;

and

Code:
            printf("sd%d: fast clock 200MHz\n", unit);
            khz = SD_FASTEST_KHZ;
            break;
        }

    /* Do at least 8 SLOW clocks to switch into the HS mode. */     <<< here we do the switch
    for (i=0; i<2; i++)
        spi_transfer(io, 0xFF);

        sd_deselect(io);             <<<<< here we finally deselect the SDcard

        spi_set_speed(io, khz);         
    }


PS1: also let us change the group capability info to 1/1/1/1/1/3 as it better maps a group position: 654321.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 5:53 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Pito,

Pito wrote:
great results!!
Indeed! Thanks to you. :)

Pito wrote:
Quote:
I guess your Lexar CL10 cards must be the winners, my guess is 2800/4000 wr/rd speeds.. 
.. at least with the read speed..
:geek: :P
Looks like the Samsung EVO (yellow) card is the best choice for LiteBSD. Delkin Devices is the fastest on write (2378 kbytes/sec), but slow on file scan (and hard to buy). Old ADATA microSD 2Gb card is an absolute champion on read (4057 kbytes/sec) and file scan (5.30 sec), but relatively slow on write. Lexar U1 cards are also pretty good.

I added a couple of slow clock writes at end of HS switching sequence, as you asked. Seems like it does not break anything. See here at lines 494-495.

I also reverted the order of printed capability groups, like 1/1/1/1/1/3.

There is one issue though. I have two cards, which work fine at 50MHz on WiFire board, but fail to boot on SDZL board. These are Delkin Devices microSD 256Mb and Samsung microSD 2Gb. I cannot explain it. Probably something is wrong with the 3.3V power supply on SDZL board.

Thanks,
--Serge


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 7:24 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
The SDZL uses maybe 250mA regulators there.
But it could be, for example, that the wifire has got some pull-ups installed at the sdcard's signals and SDZL does not. I do not have SDZL schematics, so I cannot compare.

For future designs I would be careful with the design around the sdcard - short wires of the equal length, pull-ups (ie 3k3-4k7), good decoupling (2x10u+100n+1n), large ground planes, large (and doubled) Vcc copper, and 800mA capable voltage regulator.
I would add an high-side mosfet at Vcc to be able to switch the sdcard on/off (for init).
I would also leave the 64pin and go with 100pin pic only, as we need more uarts and SPIs.

PS: fyi - stm32f4(7) - supports SDIO (4x faster access), and the slew rate of the IOs is programmable (up to 100MHz I think). So much better equipped than pic32s for the fast sdcards's usage.

PS1: Samsung owns a great flash technology today - the 3D V-NAND. The usual TLC/MLC today (with larger capacities) have got around 1000 writes per cell, Samsung 3D has got >5000.
The tests show you can get 40x more writes than advertised max with Samsung 3D V-NAND.
So when writing 16GB a day into a 16GB card you can use in saecula saeculorum 8-)

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Dec 08, 2015 8:52 am 
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
Hint: A second PS is a PPS. ;)

Sent from my SM-T555 using Tapatalk

_________________
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3

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