SD card usage notes

This page was last updated on 23 October, 2012.

This is a collection of items that may help you to make sense of the way SD cards work and hence to maximise their operational life and reliability.

Which cards to buy

Since the biggest XCSoar or LK8000 installation I've seen occupied 31MB and a log file is unlikely to ever exceed 2MB there's little point in getting a card that's bigger than 2GB. Avoid really cheap cards, especially those bought on eBay, market stalls, etc. because many have faked brand names, are much smaller than the labels say, or were made from rejected chips. Many brands, e.g. Kingston, rebadge bulk bought cards, so quality may vary depending on where the batch was made. A few brands, such as SanDisk, own their chip fabs, so they may cost more, but at least you know what you're getting if you buy them from a reputable retailer.

Card lifetime

All flash cards have a lifetime that's determined by two parameters:

Cheap cards may be designed for as few as 10,000 write cycles while premium cards are typically designed for 100,000. Most card contacts are designed for 20,000 insertions and removals. The lifetime of an SD card is unaffected by the number of times it is read. Writing involves a chemical change to the chip: each time a bit in the chip is written it is degraded slightly. The material its made of is specified to last at least the design life before it degrades sufficiently to become unreliable. Rough calculations show that a good quality card, if used in a PNA running XCSoar or LK8000, is likely to be lost or trodden on before either the chip or the contacts wear out.

However, this does assume that the card is treated reasonably carefully and its contacts are kept clean.

That said, its probably best to avoid reformatting a card unless this is absolutely necessary. In particular, if you merely delete all the data from a card before installing a new version of the programs you'll only rewrite 30 MB or so of the card while reformatting it may well rewrite the whole 2GB.

Shutting down and insertion/removal of the SD card in your PNA

Due to buffering within programs running on the PNA, the only time you can know that all data that was altered or written by your program has been safely stored on the card is when you have exited from the program. If you turn off the PNA while your program is still running there's a strong risk that data, such as configuration changes or the end of a flight log, will be lost. There's also a possibility that this may corrupt the SD card. Symptoms of corruption can range from files becoming lost or unreadable to programs on the SD card not starting. In the latter case the PNA will boot into its built-in navigation program instead of running the one you installed on the SD card. The only way to repair a corrupt card is to reformat it and reinstall all your programs and data. It is a very good idea to keep a copy of your SD card(s) on your PC and to make sure the copy is backed up.

I've been told that its also possible to corrupt the SD card by removing or inserting it when the PNA is turned on, so my shut-down routine is:

  1. Stop the program I'm running.
  2. Wait until the program has completely shut down and then turn the PNA off.
  3. Remove the card to upload logs, etc.

I always insert the SD card into the PNA before turning it on.

Finding the programs on the SD card

Windows Mobile only searches for and reads the shell.ini file from the SD card when its cold booted. This means that if you've edited or created this file and then inserted the card without restarting your PNA, Windows Mobile won't be able to find any programs on the SD card until you turn the PNA off and on again.