| Author |
Message |
|
|
Posted: Jul 17, 2008 - 04:32 PM |
|

Joined: Jan 22, 2008
Posts: 41
|
|
| Writing 10mb file 1GB SD-card take 1m20s. Is this OK? |
|
|
| |
|
|
|
|
|
Posted: Jul 17, 2008 - 04:33 PM |
|


Joined: Jan 07, 2003
Posts: 4580
Location: Oslo, Norway
|
|
Depends on your system and what it is doing at the same time.
So, short answer, sure it is fine... |
|
|
| |
|
|
|
|
|
Posted: Jul 17, 2008 - 04:54 PM |
|

Joined: Jan 22, 2008
Posts: 41
|
|
AVR32UC3A 48MHZ clock. FreeRTOS and FAT from Atmel SDK.
Only one task working. |
|
|
| |
|
|
|
|
|
Posted: Oct 08, 2008 - 11:51 AM |
|

Joined: Jun 15, 2005
Posts: 91
Location: -
|
|
with PBA at 12Mhz I would expect 12 Mbit/Sec = 1,5 MByte/Sec.
So 10 MBytes should be written in 7 Seconds ... |
|
|
| |
|
|
|
|
|
Posted: Oct 08, 2008 - 12:24 PM |
|


Joined: Aug 22, 2002
Posts: 1586
Location: Arendal Norway
|
|
| That is a theoretical speed with no prototocoles handling the data transfer. You will never get that speed in real use. |
|
|
| |
|
|
|
|
|
Posted: Oct 08, 2008 - 12:33 PM |
|

Joined: Jun 15, 2005
Posts: 91
Location: -
|
|
sure you're right, but the overhead seems too big. Its more than a factor of ten too slow ! I think that cannot be the overhead alone.
So what do think, how fast it should be in real world including protocol overhead ? |
|
|
| |
|
|
|
|
|
Posted: Mar 21, 2009 - 01:59 PM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
| i tried with my UC3B design with SPI running at 24MHz to 1GB SD card, and I got about 1MB write in 3.4 seconds. |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 07:39 AM |
|

Joined: Jun 15, 2005
Posts: 91
Location: -
|
|
with 12MHz I got 250 KB/sec.
not very fast at all ... |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 08:56 AM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
250KB/s with 12MHz SPI???
wow, that's faster than mine.
mine is about 300KB/s with 24MHz SPI |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 09:33 AM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
| and i just found out that the file_write_buf() function I used to write a 1GB microSD card has a variable execution time, sometime it could take several times more to finish. This is really bad... |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 11:11 AM |
|


Joined: Aug 22, 2002
Posts: 1586
Location: Arendal Norway
|
|
| Well an SD card buffers incoming data and then flushes its internal memory so yes you will see great variations on timing when writing to an SD card... |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 01:22 PM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
but how can I know the size of SD card's internal buffer, so that I can just have the same execution time when I use file_write_buf()
I tried to write 512 bytes every time I use file_write_buf(), but I still got variable time.
Isn't SD card internal block size 512 bytes? |
|
|
| |
|
|
|
|
|
Posted: Mar 23, 2009 - 08:21 PM |
|

Joined: Jun 04, 2007
Posts: 490
Location: Norway
|
|
| SD cards may have "sectors" of 4kB, and when you write 512 byte, worst case (every time?) would be the card must read 4kB, modify 512 byte and then write back 4 kB. I don't know if the UC3 framework supports writing multiple sectors, but if you do that there might be a much less difference between theoretical and practical writing speed. |
|
|
| |
|
|
|
|
|
Posted: Mar 24, 2009 - 04:11 PM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
| i just tried writing with 4KB everytime, and i sometimes still get about twice the normal execution time. |
|
|
| |
|
|
|
|
|
Posted: Mar 24, 2009 - 07:13 PM |
|

Joined: Jun 04, 2007
Posts: 490
Location: Norway
|
|
|
|
|
|
|
Posted: Mar 24, 2009 - 09:40 PM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
| at the moment I don't need to check for reading speed, but just want to have a good writing speed. I could check this in future. |
|
|
| |
|
|
|
|
|
Posted: Mar 25, 2009 - 07:02 AM |
|


Joined: Aug 22, 2002
Posts: 1586
Location: Arendal Norway
|
|
|
Code:
Performance
Timing Typical Maximum
Block Read Access Time 0.5 ms to 100 ms
Block Write Access Time 0.5 ms to 240 ms
CMD1 to Ready after Power-up 50 ms to 500 ms
Sleep to Ready 1 ms to 2 ms
The SD card has an internal controller that accesses the nand flash.
MCI/SPI interface -> Signel chip controller -> NAND media
Read - The read access time is defined as the sum of the two times given by the CSD
parameters TAAC and NSAC. These card parameters define the typical delay
between the end bit of the read command and the start bit of the data block.
Write - The R2W_FACTOR field in the CSD is used to calculate the typical block
program time obtained by multiplying the read access time by this factor. It
applies to all write/erase commands (e.g., SET(CLEAR)_WRITE_PROTECT,
PROGRAM_CSD(CID) and the block write commands). |
|
|
| |
|
|
|
|
|
Posted: Mar 26, 2009 - 08:13 AM |
|

Joined: Dec 31, 2008
Posts: 521
Location: Langgoens, Germany
|
|
Hi,
yesterday we got 1MB/s on a 2GB SD-Card on an EVK1101. The UC3B is running 48MHz, the SPI-SClk 24MHz but block write is done by µC, still without PDCA. |
|
|
| |
|
|
|
|
|
Posted: Mar 26, 2009 - 09:02 PM |
|

Joined: Jul 18, 2005
Posts: 803
|
|
1MB/s????!!!!
What buffer size did you use in your file_write_buf()?
or did you use file_write()? |
|
|
| |
|
|
|
|
|
Posted: Mar 28, 2009 - 03:35 PM |
|

Joined: Dec 31, 2008
Posts: 521
Location: Langgoens, Germany
|
|
Hi,
we didn't use any of these given functions of the framework. We did it ourselves but it's not very universal and not optimized. What we have done is reading the documentation of the S-D-card as for as we got it, made a lot of different tries and got a final fine working solution.
The main reason for the speed should be the write multi blocks command and we write blocks of 512 bytes each 500µs. To write one of the blocks takes 180µs only but to you have to wait until the block is excepted before you start with the next one. |
|
|
| |
|
|
|
|
|