USB drive corruption

I am not sure how to handel this one.

I am using the EMX for a data logger, which runs unattended in the field
If there is a corruption on the USB drive.
And I do a directory delete. The board hangs.
And it happens every time.
If I take and put the flash drive on a system that is running Windows Ce or my PC. I am able to delete the directory.

When the system hangs, remove the drive and let us know if it unhang the system

Also, are you sure it us not an exception that is causing your app to exit?

First, it may better to track how the corruption is happening. Are you using latest SDK?
You can do a format instead to deleting everything…

I am only deleteing 1 directory on the drive because a file is corrupted in it.

The file was corrupted because the power failed during the write previously

The file system depend on itself being in a healthy structure. If this structure got corrupted, like you said, I understand if it crashed.
The solution is to make sure files are closed gracefully…

That is true; but there is a posiblity the file would become corrupted in the field; Just thought of recovering without formating the drive. Because the directory is erasable from a Windows CE box or a PC.

Is this link anyway related to this issue

We still see file corruption sometimes

This is already fixed on

Are you closing the files before unplugging power? If you can make a program to reproduce the issue, please provide it.