FFS fsclose required?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FFS fsclose required?

Jump to solution
844 Views
kubiznak_petr
Contributor V

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)?

Labels (1)
Tags (3)
0 Kudos
1 Solution
518 Views
LuisCasado
NXP Employee
NXP Employee

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

View solution in original post

0 Kudos
2 Replies
519 Views
LuisCasado
NXP Employee
NXP Employee

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

0 Kudos
518 Views
kubiznak_petr
Contributor V

Perfect Luis, that's exactly what I wanted. Thank you.

0 Kudos