FFS fsclose required?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FFS fsclose required?

跳至解决方案
1,837 次查看
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)?

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,511 次查看
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 项奖励
回复
2 回复数
1,512 次查看
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 项奖励
回复
1,511 次查看
kubiznak_petr
Contributor V

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

0 项奖励
回复