I'm using an SST26VF (4KB block erase) flash with elm chan's FAT FS. And when I compiled it for my STM32F103 it is using up too much RAM. But Mr. Chan's application notes that memory usage doesn't on the sector size (which I have set as 4096).
Why would I be using this much RAM? My program worked perfectly fine with an SD card (FAT sector size is 512 bytes). But now when I reconfigured it for SST26VF its RAM usage is more than what the uC offers.
Electrical – Why a 4KB (erase block) flash uses too much RAM
fatflashstm32stm32f10x
Related Topic
- How to write on SD card smaller than sector size (512 bytes)
- Electronic – How to find out at compile time how much of an STM32’s Flash memory and dynamic memory (SRAM) is used up
- Electronic – Circular buffer in flash
- Electrical – STM32F4 :USB Mass Storage Write Low Speed Using FATFS Library
- Electronic – Efficient way of writing to flash memory without losing data
- Electronic – STM32, mass storage device. how to properly erase memory sectors
Best Answer
The size of the minimum erase block dictates the size of the RAM buffer required for RMW (read-modify-write) operations, at least in naive implementations. RMW operations are common in filesystem implementations, used for updating data structures such as directories and allocation tables.
It is possible to work around this by writing the updated data to a previously erased block, but keeping track of such relocations can be very tricky. This is usually done as part of a wear-leveling scheme, which is normally a separate layer of software from the filesystem logic.