SDcard wear leveling and translation layers
The article explains the Flash Translation Layer (FTL) in SD cards, which manages data storage, mapping virtual to physical addresses, and optimizing write operations for efficient performance.
Read original articleThe article discusses the Flash Translation Layer (FTL) of SD cards, which abstracts the complexities of flash memory management from the user. SD cards typically use NAND flash memory and operate in either SPI or SD bus modes, with a microcontroller managing the firmware. The boot process involves checking the interface and ensuring the correct voltage before entering the transfer mode, where I/O requests are serviced. The FTL is crucial for managing the mapping of virtual addresses to physical addresses, as flash memory cannot be overwritten without erasing first. When data is written to a sector, the FTL remaps the virtual address to a new physical address if the original is dirty. The article outlines two types of write operations: contiguous writes, which are straightforward and efficient, and random writes, which can complicate mapping and incur overhead. The FTL must maintain mapping information, and the performance can be affected by how often the write location changes. The article also highlights the importance of locality of reference for optimal write throughput, noting that contiguous writes yield better performance compared to random writes across allocation unit boundaries. Overall, the FTL plays a vital role in managing data storage efficiently on SD cards, ensuring that users remain unaware of the underlying complexities.
Related
Hacking eInk Price Tags (2021)
Hackers repurpose eInk electronic shelf labels (ESLs) into photo frames or status displays by customizing firmware. Detailed exploration of hacking challenges, including Marvell chip analysis, bootloader functions, memory storage, communication protocols, and debugging methods.
The Flash Memory Lifespan Question: Why QLC May Be NAND Flash's Swan Song
Evolution of NAND Flash memory technology faces challenges with QLC NAND due to density limitations. Transition from SLC to QLC impacts write cycles and speeds. Comparison with NOR Flash, scaling issues, and pSLC cache usage in QLC SSDs are discussed. Future alternatives like 3D XPoint are considered.
Don't snipe me in space-intentional flash corruption for STM32 microcontrollers
The MOVE student club at the Technical University of Munich develops a reliable Rust-based bootloader for STM32 microcontrollers in satellites. Rigorous testing ensures the bootloader's resilience to flash errors, offering mission continuity.
A free tool to quickly detect counterfeit flash (2017)
The F3 tool tests flash cards' capacity and performance by filling them with data and verifying accuracy. It supports multiple OS, installation methods, and extra applications for advanced testing and user feedback.
Memory Mapping an FPGA from an STM32
The article details integrating an FPGA with an STM32 microcontroller using a memory-mapped interface, emphasizing simplicity, security, and performance for embedded projects through a flexible architecture and efficient data handling.
One of the anecdotes I distinctly recall was about a batch of cards that (for obvious cost saving reasons) used the actual data flash to store its own firmware as well.
IIRC due to a bug in the wear leveling accounting, once the card got sufficiently full, the wear leveling code ended up partially overwriting the firmware itself.
Maybe someone here will know the answer to something I've been wondering for a while: When appending to a file with writes smaller than a sector, does this remapping process trigger every time? Or is the controller smart enough that it can append without remapping, even though to overwrite would need remapping?
Obviously for an SD card used for saving photos or videos you could write a sector at a time - but for an SD card in a temperature logger or similar, your appends might be a lot smaller.
I would like to see a card design which, instead of failing when there is flash wear, instead just gets smaller.
For compatibility with existing OS's, that would take the form of a self-partition-resizing sd card. It would understand fat32, ext3, NTFS, afs etc, and when the card is next powered up the partition would be slightly smaller and files physically at the 'end' would be moved inwards.
For newer OS's, a new API could be introduced which tells the OS 'this card is smaller now, please give me some blocks to mark as unavailable'.
The now-smaller card can use the removed-and-worn-out blocks to store error correction data for the remaining blocks. Ie. Additional error correction data on top of the data already stored within each page.
That effectively dramatically increases the lifespan of each page, at the cost of reduced IO performance.
Related
Hacking eInk Price Tags (2021)
Hackers repurpose eInk electronic shelf labels (ESLs) into photo frames or status displays by customizing firmware. Detailed exploration of hacking challenges, including Marvell chip analysis, bootloader functions, memory storage, communication protocols, and debugging methods.
The Flash Memory Lifespan Question: Why QLC May Be NAND Flash's Swan Song
Evolution of NAND Flash memory technology faces challenges with QLC NAND due to density limitations. Transition from SLC to QLC impacts write cycles and speeds. Comparison with NOR Flash, scaling issues, and pSLC cache usage in QLC SSDs are discussed. Future alternatives like 3D XPoint are considered.
Don't snipe me in space-intentional flash corruption for STM32 microcontrollers
The MOVE student club at the Technical University of Munich develops a reliable Rust-based bootloader for STM32 microcontrollers in satellites. Rigorous testing ensures the bootloader's resilience to flash errors, offering mission continuity.
A free tool to quickly detect counterfeit flash (2017)
The F3 tool tests flash cards' capacity and performance by filling them with data and verifying accuracy. It supports multiple OS, installation methods, and extra applications for advanced testing and user feedback.
Memory Mapping an FPGA from an STM32
The article details integrating an FPGA with an STM32 microcontroller using a memory-mapped interface, emphasizing simplicity, security, and performance for embedded projects through a flexible architecture and efficient data handling.