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.
closed as off-topic by old_timer, Chris Stratton, Voltage Spike, Autistic, brhans Apr 27 '17 at 20:42
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – old_timer, Autistic
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.