stmhal: os.sync() [apparently] doesn't flush FatFS read buffers
My time to ask dumb questions. I created a new file on pyboard's internal flash over USB mass-storage . Expectedly, it didn't show up. I issued sync on Linux side, it didn't show up. I unmounted filesystem, and it still didn't show up. I issues os.sync() on pyboard, and it still didn't show up. I had to reboot pyboard to get hold of it. I'd say, unmounting mass-storage and os.sync() should be 100% enough.
os.sync availability
Hi
Please see
https://github.com/micropython/micropython/issues/11449
@jimmo wrote:
os.sync exists for STM32 + Renesas where the filesystem is backed by internal flash with an in-RAM buffer. All other ports do not have a buffer, and writes are synchronous.
I've wasted time reading docs, finding a function, coding with it... and finding out it doesn't work because it's not implemented!
I kindly but firmly ask you to remove this function on all micros where it is a No Operation.
It will save confusion and frustration for all other developers as well.
Leaving it as NOP is terrible, because programmers think it's necessary and account for a file-system that requires sync... when it doesn't.
I've been trying to set up a PR, but it seems I don't have the privilege.