So why do the modules specify that value?Are they incorrect?
but what about writing 1 byte?Does it mean a whole block (whicever size it is) will have to be rewritten just because of it?
Is there maybe some article about how to optimally write to a card using Arduino and a microSD card module?
Both SD and SdFat already do that, and in fact is the reason why they take a good chunk of RAM.
So, writting a single byte should not update immediately the physical medium, unless:The library has to work with another sector (every 512 bytes).flush() is called afterwards.The file is closed afterwards.
One downside of this is when those changes reside only in cache and for whatever reason the system powers-off or resets; the new data will be essentially lost.
I wonder If people who use Arduino ever stumble upon case #1(or did you simply mean in #1 the case inwhich the buffer got full, and needs to be emptied?)
For this reason, a wize use of .flush() is needed,for example, after a big write() of data, and before a big delay of not writing data..Or, before performing an operation that is "risky", in terms of potentially causing any problem that might cause a reset/power-off/etc
Yes, but just a physical sector, not a whole filesystem-defined cluster (unless it's also set as 512 bytes).It's also because how NAND flash memories write data (page erase-program cycle).