• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

How-To: Make your CF or SD media last longer.

Started by Blight, January 21, 2006, 01:29:04 PM

Previous topic - Next topic

Blight

I see a lot of people asking for saves because their media crashed, that's why i wanted to write a short article about how to make it last longer.

One thing that is very important to know is than a flash card has an maximum amount of writes per bit, meaning every bit can be overwritten a fixed amount of times. The only thing on the media that is overwritten quite often are the places where the saves are located. so every so often go grab a random file of 256 KB(like another save file) erase everything on the media, format the drive to keep ik nice and clean and put on the 256 KB file. After that you can put all your other files on the flash-media again. What this does is let the worn out places where the saves were contain normal rom data which doesn't change often. You can keep doing this untill the size of all the 256 KB files combined is equal to the smallest rom you have. After that you can delete all the 256 KB files and start over. But if you have 25 32MB+ games and 1 8MB you can also grab the one 8 MB game and place is on a diffirent location on the flash media. If you want to do this, you erase an amount of data(that varies every time you do this.) from your media and place the 8MB game there then write back all other files.

This all may seem a lot of effort but it can increase you media's lifespan by 10 times.
Also don't do this too often or else you damage the card by writing to every spot on the card too much.

Another thing to do is to keep your media defragmented for a couple of reasons.
1. The games will run faster if the FAT file system doesn't have to be accessed every time a piece of the rom has to be retrived.
2. Your media will last longer because it doesn't have to retrieve the location of the pieces of the rom every time it has to load something.
you can defragment your media by moving everything to your hard drive and back again or you can use windows defragmentation utility by right clicking on the media's drive, selecting properties and after that selecting tools and defragment. though this second method requires at least 15 % of free disk space on your flash media. I would also recommend the former because you can format your drive when it is empty, this will improve it's performance.

In short change the place where the saves are stored on the card every so often by adding 256 KB in the beginning of the media and keep your media defragmented at all times.

Feedback would be appreciated.
\__/)
(o'.'o)
(")_(") This is Bunny. Copy Bunny into your signature to help him gain world domination.

PHERK

Well this is a good guide, because i had no idea that CF/SD Cards died after a certain amount of writings.
C-CF
512 MB Sandisk CF Card
Flashme v.6

Blight

Yeah, I realised that a lot of people thought that way.
flash just works like a lot of switches that can be set to 1 or 0. after a while they wear out and the card dies. By changing which swich you use you can keep the card alive longer.
\__/)
(o'.'o)
(")_(") This is Bunny. Copy Bunny into your signature to help him gain world domination.

cory1492

Isnt the failure spec something like 10,000 or 100,000 writes (if not more)?

Blight

ussually it's something like this:
QuoteMinimum 100.000 erase cycles
Minimum 10.000 insertions
but it goes a lot faster than that if you keep using thesame spot on the flashcard.
the estimate is for when you use it for like a digital camera.
some games have savepoints every 5 minutes.
if you play it for 2 hours you already got yourself 60 writes to thesame spot. that's what makes the supercard different, you don't shoot a picture and delete the old one every 5 minutes.
\__/)
(o'.'o)
(")_(") This is Bunny. Copy Bunny into your signature to help him gain world domination.

dai_uk

I can see what you're saying but the SC only saves when users choose to transfer the save to CF / SD otherwise it's in the SC's Ram so whilst you are saving to the same spot with that game it's not as frequent as you mention
Damo

Blight

I'm assuming you're using the DS function of the supercard, or else you could use smaller 64 KB files if you're only using the GBA mode.
\__/)
(o'.'o)
(")_(") This is Bunny. Copy Bunny into your signature to help him gain world domination.

mr_jrt

Err...guys. The media cards have wear spreading algorithms inside them that do that all automatically. Think of it like the way ram is used in protected mode on a PC, the CPU translates the memory addresses to physical addresses transparently to the software running, this is how things like virtual memory can be used (ah! that page of ram isn't loaded! and then the OS swaps it in from disk :) and all is well)

Anyway. Unless you have super-mega-cheapo media, they will have some sort of levelling present on them. Think about it, given that these cards are almost always FAT-formatted, don't ya think that the FAT would be the first to  wear out as it's always in the same place? This DID use to happen with old, old, old cards. But anything within the last few years should be just fine.

Blight

Quote from: "mr_jrt"Err...guys. The media cards have wear spreading algorithms inside them that do that all automatically. Think of it like the way ram is used in protected mode on a PC, the CPU translates the memory addresses to physical addresses transparently to the software running, this is how things like virtual memory can be used (ah! that page of ram isn't loaded! and then the OS swaps it in from disk :) and all is well)

Anyway. Unless you have super-mega-cheapo media, they will have some sort of levelling present on them. Think about it, given that these cards are almost always FAT-formatted, don't ya think that the FAT would be the first to  wear out as it's always in the same place? This DID use to happen with old, old, old cards. But anything within the last few years should be just fine.
That is true but it is only for the first sectors of the drive.
the others will somtimes be shut down but mainly will cause the card to die.
I had an stupid mp3 player with CF card support that broke my cards in like 2 months, so I did my research and then this came up.
It seemed the thing found it necessary to write what you listen to the CF card so it you turn it off and grab another CF card, and than put your old one back in it begins playing from your original position. the problem was it did this every 4 minutes at exacly thesame spot on the card which ultimatly caused the card to crash. After that I realised this applies to the supercard too.
when I checked I had 1 256KB nds save corrupt and another 64 KB gba save on another CF card. you can easily check this by right clicking on your drive after formatting it and selecting properties. if it shows 0 bytes used you're fine. if in my case it shows 64 bytes used a sector on your card has died. (Note: FAT16 does not always show it this way if you want to be a 100% sure format it in FAT32)

But yes you were right, it does have that technology in the first sectors of the drive where the most crashed used to accure.
\__/)
(o'.'o)
(")_(") This is Bunny. Copy Bunny into your signature to help him gain world domination.

MukiEX

Boy, and here I thought that FAT on a flash card had some minute modifications to route around broken sectors. That way the only problem you'll notice is that little by little, the amount of available memory on the card would lessen.

Haoie

Hold on, I'm glad this old topic got brought back up.

Is there any definite number of rewrites a card can have? Or timespan it'll work?

Either way it's suggestable that your games are backed up on PC [which I should do soon].
If each mistake being made is a new one, then progress is being made.

MAD2X

Since I read this topic a while back, every time a ds game saves I think about my SD slowly dying! I dont know how often I should backup everything, format my card and put stuff back sorted in a different way. But I sure know it's a pain everytime, it ends up in less playing time! I used to do it often when i first got my card, but now I'm starting to get annoyed of doing that, I just hope I can still get a lot of life from this SD card!
ilver NDS w/Flashme V.6
Supercard SD v1.61 firmware
1 GB coreMicro high speed card

acky

Make an autoexec script that copies all your *.sav files to local disk.

QazzaQY2K

This really sounds strange, i belive this isn't that true .. sure the blocks migt get curupt and die but the write controller in the chip do actualy mark them and reroute to othere blocks. Most card even have long warentys even some have life time warenty so no issue if it breaks down..  i even had a Kingston 2gb the was all new broke down on me.. even zero'd it out .. anyway .. the file system is most of the time the first sector bank of 4086 bytes .. and that can be changed by it self as the card get the right feedback from the sector banks (aka blocks).. any card should have a life span of 5 years depending on the die type. Also if i'd die on you there are a few ways to revive dead cards .. if the ini controller isn't dead and only some messed up boot sectors (MRS) then no need to worry really..

just my 2 cent

mr_jrt

Thank you QazzaQY2K, its heartening to know that at least someone else is on the same wavelength as me.  :wink: