Hi,
can someone please explain how to correctly write data to NAND flash using the FFS subsystem? In the mfs_nandflash demo, I can open the filesystem and read/write data from/to it, everything works fine. The only problem is that written data is not persistent unless I close the filesystem (fsclose) after the changes performed, i.e. if I simply write a file and turn off the power, the change is gone after I turn the power on again.
So, if I want to write a file, do I always have to close the filesystem to make the changes persistent? That doesn't seem to me like a good solution (by the way it also looses the point of MFS generality then). Or is this just a kind of misbehaviour on my side (maybe a wrong configuration)?
Solved! Go to Solution.
Hi Petr,
Have a look at the new nand ffs example in MQX 4.1.1. MQX 4.1.1 release notes:
MQX-4216 The FFS NAND Flash FFlush malfunction issue is fixed. The IO_IOCTL_FLUSH_OUTPUT ioctl is introduced to flush media on FFS NAND memory and make sure that the flush process is complete. The low-level flush on MFS is implemented when closing the file handler.
Now you have a procedure of flushing data without closing the file system "return_code = fflush(filesystem_handle);”
Luis
Hi Petr,
Have a look at the new nand ffs example in MQX 4.1.1. MQX 4.1.1 release notes:
MQX-4216 The FFS NAND Flash FFlush malfunction issue is fixed. The IO_IOCTL_FLUSH_OUTPUT ioctl is introduced to flush media on FFS NAND memory and make sure that the flush process is complete. The low-level flush on MFS is implemented when closing the file handler.
Now you have a procedure of flushing data without closing the file system "return_code = fflush(filesystem_handle);”
Luis
Perfect Luis, that's exactly what I wanted. Thank you.