fflush vs WRITE_THROUGH for mfs

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

fflush vs WRITE_THROUGH for mfs

504 Views
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?

Labels (1)
0 Kudos
1 Reply

235 Views
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 Kudos