Reading this question on load-leveling of writes on a MicroSD card, Is it true that a SD/MMC Card does wear levelling with its own controller?, it prompted me to wonder where on the MicroSD card is this load-leveling data stored? Is it kept in permanent memory outside of the normal memory storage space? Or is it kept in a partition table and if I reformat the MicroSD card, will the load-leveling data be deleted?
-
3The partition table is a file system level concept. The file system is in turn stored on the block device, which in this case is the SD card. The SD card controller can’t store wear levelling information on any block that it advertises to the host. Therefore we can assume it is kept in some dedicated memory, either spare flash (not advertised to the host) or a separate non-volatile memory (e.g. internal to the controller IC). – David Mar 18 '20 at 23:05
-
@David that comment should be an answer I can upvote :) – Marcus Müller Mar 19 '20 at 00:05
1 Answers
SD cards comprise a memory store (usually NAND), and a microprocessor to manage the memory, maintain a physical-to-logical block map, and present the interface to the host. The logical address space has fewer blocks than the physical store. In addition, an erase/program (EP) cycle count is maintained for each physical block. This ultimately enables wear-leveling and bad block management.
Only the logical address space is presented to the host. Reformatting an SD card (say as a FatFS) will not change the internal bad-block flags or EP cycle counters.
What actually happens under the hood is manufacturer- and card-specific, and most likely a guarded trade secret. Some manufacturers (especially, of industrial grade cards) provide proprietary tools to monitor the health of their devices, and may even allow low level reading and resetting of flags and counters.
Cost determinants include underlying NAND memory type (SLC is more expensive than 3D), the logical to physical block ratio, and the availability of management tools.

- 43
- 6