FATFS bogus Directory
From: Johannes Heusel (development_at_NO.narda-sts.SPAM.de)
Date: 04/28/04
- Next message: cris: "Ethernet driver problems"
- Previous message: Dean Ramsier: "Re: Question about IMGNODEBUGGER"
- Next in thread: George McCollister: "Re: FATFS bogus Directory"
- Reply: George McCollister: "Re: FATFS bogus Directory"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 19:20:33 +0200
Hello,
We are using WinCE 4.2 and having problems with the flash file system. We use stratad.dll, mspart.dll to get a FATFS file system running. It still runs but sometimes we got a bogus directory after startup. We still work on, but if I try to save a dataset the CreateFile function does not give a invalid handle. So the dataset is not saved on disk but Create file returned with a valid handle. (see example below)
Also we use ScanVolumeEx and DefragVolumeEx functions from Fatutil.dll to check our file system. Those function tells no problem. But we still have. Also is the return value from DefragVolumeEx (DEFRAG_RESULTS including only SCAN_RESULTS)not actual. The values from dr.sr are the same as from a scan before doing defrag. So what could I do with that result? Is there any example code how to use the FATUTIL functions?
Before we power off the system we dismount all flash partitions and dismount the flash volume.
Then we do a hard power off, because we start our system always new(no changing registry)
Now my questions:
What went wrong that I get bogus directories?
How could I detect the bogus directory problem and how could I repair my files?
Why could ScanVolume not detect the bogus directories?
What happens if power fall down without dismounting all the Flash stuff and what could I do to prevent that?
Must I use the TFAT format, and when yes could I use the "old" formatted Volume without data lost?
Is it enough to dismount all flash stuff or must I do more than this?
A lot of question with the hope for a helpful answer
Johannes Heusel
Thanks!!
Debug trace:
906317 PID:edbb6efe TID:edbb62c2 0x8dbb7000: +SetMeasData (tsDATA_PARAM)
906320 PID:cdfe35a2 TID:edbb62c2 0x8dbb7000: FATFS!FindNext: bogus directory!
906320 PID:cdfe35a2 TID:edbb62c2 0x8dbb7000: FATFS!FAT_GetFileAttributesW(\000\040422142439-01.dat) returned 0xffffffff (13)
906321 PID:cdfe35a2 TID:edbb62c2 0x8dbb7000: FATFS!FindNext: bogus directory!
906356 PID:edbb6efe TID:edbb62c2 0x8dbb7000: -SetMeasData:eNO_ERR
Source code example:
// create a new file.
hFile = CreateFile(strFilePath, GENERIC_WRITE, 0,NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
nErr = GetLastError();
if (nErr != ERROR_FILE_EXISTS)
{
RETAILMSG(DEBUG_MEAS_API, (_T("-SetMeasData:eERR_ACCESS %d=GetLastError()\n"),nErr));
return eERR_ACCESS;
}
}
//...rest of code
- Next message: cris: "Ethernet driver problems"
- Previous message: Dean Ramsier: "Re: Question about IMGNODEBUGGER"
- Next in thread: George McCollister: "Re: FATFS bogus Directory"
- Reply: George McCollister: "Re: FATFS bogus Directory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|