[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
"Flags"=dword:00240074
"FormatTfat"=dword:1 ; Format partitions to be TFAT
"EnableWriteBack"=dword:1
"MountAsBootable"=dword:1
Where Flags are :
FATFS_FORCE_WRITETHROUGH
FATFS_DISABLE_AUTOFORMAT
FATFS_DISABLE_AUTOSCAN
FATFS_ENABLE_BACKUP_FAT
FATFS_TRANS_DATA
FATFS_TFAT_ALWAYS
if I use CeGetVolumeInfo function from an application it returns the
following flags :
CE_VOLUME_FLAG_STORE
CE_VOLUME_FLAG_WFSC_SUPPORTED
CE_VOLUME_FLAG_LOCKFILE_SUPPORTED
CE_VOLUME_FLAG_TRANSACT_WRITE
Can I am sure that the TFAT is enable on the NAND Flash ?
Why CeGetVolumeInfo doesn't return CE_VOLUME_TRANSACTION_SAFE setted ?
Thanks,
Paolo
I have this problem too.
There is a probleme with cegetvolumeinfo and windows CE 5.0
With this link, you will find how to call the function, but the return of
the function is incorrect.
http://blogs.msdn.com/ce_base/archive/2006/10/25/i-m-trying-to-use-cegetvolumeinfo-but-my-application-won-t-link-correctly.aspx
In my case, I give "Partition2" in parameter, and the function return
"Part3" in the result.
I have some probleme when I call a defrag on TFAT. After defrag, I can see
the size of the files bigger than previous. So i wanted to know if the
partition was really TFAT with the flag CE_VOLUME_TRANSACTION_SAFE.
Another question : When you defrag a TFAT disc, which FAT do you select (0
or 1) ? Are they both identical ?
If you don't get CE_VOLUME_TRANSACTION_SAFE returned by
CeGetVolumeInfo, then it's not a transaction safe partition on the
disk. Whether you have a FAT or TFAT partition depends on how the
partition was formatted, so in addition to getting the right registry
settings, you have to reformat the partition. You can do this using
the storage manager control panel applet. Obviously, you also have to
add in the TFAT components from the catalog.
Sorry, don't know anything about defrag... didn't even know it was
possible under win ce!
Andrew.
My windows Ce 5.0 OS have been created including fatfs.dll.
The partition is formatted in TFAT by the Windows tool.
Then when i defrag with the windows tool, i see the files bigger than
previous.
The bug with CegetVolumeInfo on Windows Ce 5.0 seems to be knowed by
Microsoft.
There is also others bugs :
http://support.microsoft.com/kb/974394/en-us
This is my OS configuration :
/******************************************************************/
HKEY_LOCAL_MACHINE\System\StorageManager\BinFS
Dll : binfs.dll
FriendlyName : BIN Filesystem
Paging : 1
HKEY_LOCAL_MACHINE\System\StorageManager\FATFS
Dll : fatfsd.dll
Flags : 100
Util : fatutil.dll
Paging : 1
FriendlyName : FAT Filesystem
EnableCache : 1
CacheSize : 0
CacheDll : diskcache
HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk
AutoFormat : 1
AutoMount : 1
AutoPart : 1
DefaultFileSystem : FATFS
Folder : NAND Flash
Name : MXFLASH
HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS
Flags : 36
MountAsBootable : 1
MountAsRoot : 1
/******************************************************************/
These config have been done by another person that me.
Can you tell me if it is correct to use TFAT ?
When i start the defrag tool, I can check TFAT, and "2 FAT" is
selected automatically.
Thanks
I don't see any settings for TFAT in the registry... here's a set of
working CE 5.0 registry settings for TFAT (but you also need to
include TFAT from the catalog):
; This file is to be included in platform.reg if required.
;
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NORFMD]
"FriendlyName"="NOR FLASH Driver"
"Dll"="norfmd.dll"
"Order"=dword:0
"Prefix"="DSK"
"Profile"="MSFlash"
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"MemBase"=dword:BC000000
"MemLen"=dword:01E00000
"XIPEntireFlash"=dword:0
"SectorSize"=dword:200 ; 512 bytes
"BlockSize"=dword:20000 ; 128KBytes
"WriteBufferSize"=dword:20 ; 32 bytes = 8 doublewords
"Flags"=dword:1000
; Support XIP in IMGFS
;[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\IMGFS]
"XIP"=dword:1
; Override names in default profile and force auto part and AutoFormat
if required
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
"Name"="MSFLASH for MirrorBit"
"Folder"="FlashDrive"
"MountFlags"=dword:2
"AutoPart"=dword:1
"AutoFormat"=dword:1
; "MountAsBootable"=dword:1 ; equivalent to "MountFlags"=dword:2
; @CESYSGEN IF CE_MODULES_TFAT
; Valid Bits for Flags registry value
;FATFS_UPDATE_ACCESS 0x00000001 Updates access times.
;FATFS_DISABLE_LOG 0x00000002 Disables event logging.
;FATFS_DISABLE_AUTOSCAN 0x00000004 Disables automatic calls to
ScanVolume.
;FATFS_VERIFY_WRITES 0x00000008 Verifies all writes.
;FATFS_ENABLE_BACKUP_FAT 0x00000010 Adds a backup FAT to all
formats.
;FATFS_FORCE_WRITETHROUGH 0x00000020 Sets all files to
WRITE_THROUGH, regardless of the parameters to CreateFile.
;FATFS_DISABLE_AUTOFORMAT 0x00000040 Disables automatic formatting
of unformatted volumes.
;FATFS_WFWS_NOWRITETHRU 0x00010000 Disables write through on the
WriteFileWithSeek function. Improves memory-mapped file performance.
;FATFS_DISABLE_FORMAT 0x00020000 Disables format.
;FATFS_TRANS_DATA 0x00040000 Transacts data on a write operation.
;FATFS_TFAT_NONATOMIC_SECTOR 0x00080000 Uses the cluster 1 entry in
the FAT table for a TFAT transaction. TFAT uses the NOF field of the
boot sector by default.
;FATFS_DISABLE_TFAT_REDIR 0x00100000 Disables the redirect of the
root directory to another hidden directory for FAT12 or 16.
;FATFS_TFAT_ALWAYS 0x00200000 Marks transaction status, even if
only one sector in FAT is changed.
;FATFS_FORCE_TFAT 0x00400000 Forces TFAT transactions even if the
volume is not formatted as TFAT.
;FATFS_LFN_EXTENDED 0x00800000 Generate LFN entries for extended
characters always
;FATFS_TFAT_DISABLE_MOVEDIR 0x01000000 Disable movefile on a
directory for TFAT because it isn't transaction-safe
; format this volume as TFAT, with atomic writes optimised according
to Microsoft's recommendations
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
"BufferSize"=dword:40
"Flags"=dword:00010014 ; FATFS_DISABLE_AUTOSCAN +
FATFS_ENABLE_BACKUP_FAT + FATFS_WFWS_NOWRITETHRU
"FormatTfat"=dword:1
"EnableCache"=dword:1
"EnableWriteBack"=dword:1
"EnableFatCacheWarm"=dword:1
"EnableDataCacheWarm"=dword:1
"FatCacheSize"=dword:0 ; OS decides
"DataCacheSize"=dword:0 ; OS decides
; @CESYSGEN ENDIF CE_MODULES_TFAT
[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\MSFlash]
"DriverPath"="Drivers\\BuiltIn\\NORFMD"
"LoadFlags"=dword:1 ; load synchronously
"Order"=dword:0
"BootPhase"=dword:1
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FlashDrive]
"MountFlags"=dword:2
; "MountAsBootable"=dword:1 ; equivalent to "MountFlags"=dword:2
Hello,
I Thank you for your response.
I work with NAND Flash. This configuration will be OK with NAND
Flash ?
Are only the flags which define the TFAT configuration ?
How do you construct the configuration ? Must I add the registry keys
"One by one", or can I use a specific tool ?
Thanks for all
Bruno
Yes, this will work with any type of flash, NOR or NAND; it just
happens that I copied it from a platform that used NOR flash.
The first registry entries... [HLKM\Drivers\BuiltIn\NORFMD] loads the
block driver for the NOR flash. You need to replace this with the
appropriate entries for your NAND flash block driver. The important
entry in this section is "Profile"="MSFlash". This is used to "link"
the physical block driver to a profile in the storage manager registry
section, in this case [HKLM\System\StorageManager\Profiles\MSFlash].
Everything in this section applies to the storage manager which
operates on top of the hardware specific block driver. This is where
the TFAT entries are placed.
To add the entries to your build, you should place them either in
platform.reg or project.reg. I actually prefer to keep registry small
registry files with the drivers then include them in platform.reg.
This means that I can edit the registry settings in the files that are
included and do a small incremental build, rather than a full sysgen.
For example, the file above is included into platform.reg as follows:
; @CESYSGEN IF CE_MODULES_FATFSD
IF BSP_NOR_FLASH
#include "$(DRIVERS_DIR)\norfmd\norfmdk\norfmd.reg"
ENDIF
; @CESYSGEN ENDIF CE_MODULES_FATFSD
Andrew.
What do you think about this value ?
Do you think I can change this value with no data loss ?
Thanks
Bruno
Sorry, I don't know. I think you'll have to experiment!
Andrew.