Post Reply 
HP 50g & SD Cards: Performance, Format, Notes
07-18-2016, 07:44 PM (This post was last modified: 07-18-2016 08:08 PM by matthiaspaul.)
Post: #21
RE: HP 50g & SD Cards: Performance, Format, Notes
(07-18-2016 04:46 AM)Claudio L. Wrote:  For compatibility reasons, you should buy a modern 2 GB card, just create a 256 MB partition to keep the calculator boot times reasonable (or better off, try different sizes and combinations of partition size/cluster size until you find the best for you). The rest of the card is not going to be unused, as SD cards have internal level-wearing. This means you will use the whole 2 GB of flash, just that your card will last much longer than a smaller card.
This sounds like a great idea at first - but it won't work as excepted, unfortunately, at least not to the extent suggested. It would work as described if it would be possible to completely "deallocate" the unused sectors from external access, but this is impossible except for by reprogramming the internal configuration of the card. [*]

A 2 GB card will "expose" sectors worth 2 GB to the user. Even if the card holds only a 256 MB partition, the unused and possibly uninitialized sectors outside of this occupied area still hold some contents. Even if these sectors contain nothing but random trash (most probably FFh or 00h on a flash card), reading the same sector again somewhen in the future will return exactly the same contents (unless there was a write access in between). The card's firmware can detect that these sectors won't be used as frequently as those inside the 256 MB partition, but it cannot know that nobody would care if the firmware would return fake data instead of the actual contents. Hence, the firmware must treat it as occupied space, which cannot be used as backup area for wear-leveling.
The space used for wear-leveling is extra space (beyond those 2 GB) inside the card, which isn't accessible from the outside.

Nevertheless, the fact that the backup space was dimensioned for a 2 GB card of which now only 256 MB are actually used should still cause the card to last longer than a genuine 256 MB card before all internal backup storage has been used up.



PS. [*] Well, there is one exception: For as long as there never was a write-access to a card's sector, the card's firmware could still treat that sector as "unoccupied" and return fake data on reads without consequences. However, even a single write access to a sector would invalidate this forever.
As flash cards come preformatted to their nominal capacity, at least one write will usually happen as part of the production process. Even if the initial formating would skip initializing the free space areas in the filesystem, filling the card once or repartitioning/formatting it would force the card's firmware to treat sectors as occupied afterwards, and therefore no longer available as backup.

"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: HP 50g & SD Cards: Performance, Format, Notes - matthiaspaul - 07-18-2016 07:44 PM

User(s) browsing this thread: 1 Guest(s)