2016-06-27 07:48 AM
we try to use a uSDcard efficiently to log process Data. This works great. Now we would like to erase certain sectors in order to have a kind of a ''ring buffer'' for these process Data.
We can't find any documentation for such low level chip handling, (similar to flash handling onchip flash in STM32 chips). Has anyone any experience in this? Or is the controller on a uSDcard ''hiding'' everything? Erase a file using Fatfs does not really erase anything but just mark something as erased.2016-06-27 08:51 AM
Correct, FatFs just manages files system structures, which are agnostic to the underlying media, and what it might do.
If you want to manage the erase blocks on the media, then you are going to have to become familiar with the command set of the MMC/SD cards themselves. The flash controller on the card (small micro) manages the blocks, deblocking, erase, and wear management. The erase block on the media is probably 128KB, see geometry specification returned by card, this is generally unmanageably large for a micro-controller, and the 512 byte block level is similar to that of classical hard drives.Unless you have some particular file system, and block storage media skills, it's going to be a bit of a chore to navigate through the FAT file system structures, mapping blocks to erase underlying flash array, especially where unaligned, or non-contiguous runs are involved.2016-06-28 11:47 PM
Thank you clive, we thougt so. We will work with time stamps in the data.