fflush vs WRITE_THROUGH for mfs

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fflush vs WRITE_THROUGH for mfs

1,381件の閲覧回数
njk909
Contributor II


I am using 52259 with mqx 4.0.1.  I was originally doing an fprintf followed by an fflush for every write to a file.  I am doing a write every 50ms.  After several hours of run-time, my USB device just randomly detaches mid write and creates an unhandled exception.  I thought maybe the fflush was causing it, so I tried to get rid of that and change to using

param = MFS_WRITE_THROUGH_CACHE;

(usb_fs_ptr->FS_FD_PTR, IO_IOCTL_SET_WRITE_CACHE_MODE, &param);

For some reason now the writes to file are taking almost 10x longer than they were when I was using fflush.  Any ideas why?  Is that normal?

ラベル(1)
0 件の賞賛
返信
1 返信

1,112件の閲覧回数
soledad
NXP Employee
NXP Employee

Hi Nathan,

Please check the below threads,

MFS Corruption

Howto flush MFS? (Use case: mfs onto ramdisk)


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信