Hi, All

My system configuration EP9315(ARM9)+WINCE50 with 32MB Norflash, part of it
is used to store nk.bin, and the remaind is used as flash disk with HIVE
saved in it. The related registry are following

; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NORFlash]
"Dll"="ep93xxnorflash.dll"
"Order"=dword:2
"Prefix"="DSK"
"Ioctl"=dword:4
"Profile"="MSFlash"
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"

; Override names in default profile
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
"Name"="EM9000 NOR Flash"
"Folder"="NOR Flash"
"AutoMount"=dword:1
"AutoPart"=dword:1
"AutoFormat"=dword:1
"MountAsBootable"=dword:1

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
"FriendlyName"="TFAT FileSystem"
"Dll"="fatfsd.dll"
;Flags registry subkey
;
; FATFS_TFAT_ALWAYS | FATFS_TFAT_NONATOMIC_SECTOR | FATFS_WFWS_NOWRITETHRU |
; FATFS_ENABLE_BACKUP_FAT | FATFS_DISABLE_AUTOSCAN
;
"Flags"=dword:00290014
"Paging"=dword:1
"EnableCache"=dword:1 ;improving performance for registry hive file on
TFAT volume
"EnableWriteBack"=dword:1 ;improving performance for registry hive file
on TFAT volume
"EnableFatCacheWarm"=dword:1 ;improving performance for registry hive file
on TFAT volume
"FatCacheSize"=dword:0 ;improving performance for registry hive file on
TFAT volume
"EnableDataCacheWarm"=dword:1 ;improving performance for registry hive
file on TFAT volume
"DataCacheSize"=dword:0 ;improving performance for registry hive file on
TFAT volume
"FormatTfat"=dword:1 ;format the volume as TFAT on auto-format
;not use any more for CE5.0
; "CacheSize"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\MSFlash]
"DriverPath"="Drivers\\BuiltIn\\NORFlash"
"LoadFlags"=dword:1
"Order"=dword:0

[HKEY_LOCAL_MACHINE\init\BootVars]
"SystemHive"="HiveRegistry\\system.hv"
"ProfileDir"="HiveRegistry"
"Flags"=dword:1
"RegistryFlags"=dword:1

; END HIVE BOOT SECTION

The problem is that the flash disk size may miss 252KB if the power is off
during file copy opration. And with many 252KB-missed events, the norflash
disk is corrupted. It's appreciated for any advises. Thanks!


Cheng Shi
Emtronix
5# Gaopeng Dadao, Chengdu
China 610041
86-28-86180660
www.emtronix.com

Re: about norflash file system problem by Joel

Joel
Mon Apr 14 09:21:56 PDT 2008

> The problem is that the flash disk size may miss 252KB if the power is off
> during file copy opration. And with many 252KB-missed events, the norflash
> disk is corrupted. It's appreciated for any advises. Thanks!


It sounds like the block driver is not atomic.

This may be helpful:
http://msdn2.microsoft.com/en-us/library/aa916012.aspx

Re: about norflash file system problem by Steve

Steve
Tue Apr 15 11:02:26 PDT 2008

On Apr 14, 12:21 pm, Joel Winarske <joel.winar...@gmail.com> wrote:
> > The problem is that the flash disk size may miss 252KB if the power is off
> > during file copy opration. And with many 252KB-missed events, the norflash
> > disk is corrupted. It's appreciated for any advises. Thanks!
>
> It sounds like the block driver is not atomic.
>
> This may be helpful:http://msdn2.microsoft.com/en-us/library/aa916012.aspx

We had the exact same symptoms with NOR flash and CE 5.0. Turns out
that one problem was that the BSP author had removed the SignBlock() /
VerifySignature() functions in the flash driver (compare to MS flash
driver @ C:\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD
\STRATA). This functionality was designed to protect the filesystem
against interruption of block erase, which in NOR flash takes about a
second. Apparently if a block erase is interrupted the block is in an
indeterminate state and various parts of the filesystem layer get
confused. So putting these functions back in at least partially fixed
the problem.

Re: about norflash file system problem by Cheng

Cheng
Tue Apr 15 18:16:43 PDT 2008

Thanks for your comments

"Steve Hugg" <sehugg@gmail.com>
??????:6c2e7232-7740-4a9f-ac46-8fb1580ccdb1@q10g2000prf.googlegroups.com...
> On Apr 14, 12:21 pm, Joel Winarske <joel.winar...@gmail.com> wrote:
>> > The problem is that the flash disk size may miss 252KB if the power is
>> > off
>> > during file copy opration. And with many 252KB-missed events, the
>> > norflash
>> > disk is corrupted. It's appreciated for any advises. Thanks!
>>
>> It sounds like the block driver is not atomic.
>>
>> This may be
>> helpful:http://msdn2.microsoft.com/en-us/library/aa916012.aspx
>
> We had the exact same symptoms with NOR flash and CE 5.0. Turns out
> that one problem was that the BSP author had removed the SignBlock() /
> VerifySignature() functions in the flash driver (compare to MS flash
> driver @ C:\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD
> \STRATA). This functionality was designed to protect the filesystem
> against interruption of block erase, which in NOR flash takes about a
> second. Apparently if a block erase is interrupted the block is in an
> indeterminate state and various parts of the filesystem layer get
> confused. So putting these functions back in at least partially fixed
> the problem.