I use lpc4357, and config file system & usb0 following the demo code of MCB4300. The usb seems work, for I can read/write file via the usb interface. When I create file failed by calling
fopen("TEXT.txt","w")
, it failed; but, calling
fopen("TEXT.txt","rb")
seems ok (the return file handler not null if the file exist). I just wander, what went wrong? Any idea is welcome!
Note that for a USB file system, the PC assumes it owns the file system which allows it to cache data from the memory.
How often have you seen a USB thumb drive that suddenly modifies files or adds files without the PC you connected it to actually accessing the drive?
The way to allow multiple sources to perform updates to the same file system would basically be to implement a networked server. A computer that accesses a server knows that the information is shared, so any information not explicitly locked may be changed by someone else at any time.
Thanks for your reply, Per Westermark!
The device we are developing, will power up when plugging into usb port. And, it allows user to enter mass storage mode manually.
So, the user may do some options (create/delete/rename/...) during the usb0 is on. If, I say if, the file system in the MDK does not allow to do that, then we will try to add some prompt to tell the user avoid a try.