none
PXA270 WinCE 6: NOR StrataFlash Driver file system corruption RRS feed

  • Question

  • Hello,

    I have problems with the Intel NOR Flash driver. We are working with PXA270, WinCE 6, P33 Numonyx Flash and Intel StrataFlash NOR Driver.

    The driver works, but I have implemented a duration test which copys to the NOR Flash or deletes files on the NOR Flash. During the access to NOR FLash I turn off the voltage. In most of the cases the filesystem is valid after restart, but sometimes the filesystem is corrupt and the storage device can't be mounted.

    Has anyone experience with the driver?

    I error case I get the following debug messages at restart:

    FILESYS: RAM File System FSD_MountDisk registering folder "Object Store"
    FSDMGR!MountTable_t::RegisterVolumeName: Registered "Object Store" at index 4FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 4 (Name="", MountFlags=0x46)FSDMGR!AutoLoadFileSystem: CurrentBootPhase=0, RootKey=System\StorageManager\AutoLoad, FileSystem_t=MSFlash
    FSDMGR!AutoLoadBlockDevice: Auto-loading block driver from "Drivers\BuiltIn\StrataFMD"FSDMGR!MountStore: Attaching new storage device "MSFlash"Kernel DLL 'stratad.dll' needs thread creation/deletion notification
    INFO: FMD_Init: -> InitializeFlash() 256 Blocks unlocked from virtual Flash Address =0xd0220000
    INFO: FMD_Init: Flash Address=0xd0220000  Length=0x2000000.
    FLASHDRV.DLL:BuildupMappingInfo() - Enter. 
    Unknown: DEBUGCHK failed in file C:\ymzki\private\winceos\DRIVERS\msflash\src\.\log2physmap.cpp at line 346 
    DEBUG_BREAK @c0ff3aa0 Ignored.
    FLASHDRV.DLL:MappingTable::MapLogicalSector() - Logical sector(0xbbffbfeb) is out of range
    Unknown: DEBUGCHK failed in file C:\ymzki\private\winceos\DRIVERS\msflash\src\.\fal.cpp at line 755 
    DEBUG_BREAK @c0ff1080 Ignored.

    Best regards,

    Andreas

    Tuesday, September 18, 2012 7:36 AM

All replies

  • The fact that you experience some filesystem corruption in that specific scenario is not strange. A common approach to avoid this is to use specific filesystem drivers: MSFT provides  a transactional FAT file system (http://msdn.microsoft.com/en-us/library/ee490643(v=winembedded.60).aspx) which may help in this case. There are also commercial alternatives like Reliance by Datalight


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Tuesday, September 18, 2012 9:21 AM
  • Hi,

    thanks for your fast answer. I think that I use TFAT filesystem, but I'm not really sure. I use the following registry settings: 

    [HKEY_LOCAL_MACHINE\System\StorageManager\EXFAT]
    		"FormatTFat"=dword:00000001
    				
    [HKEY_LOCAL_MACHINE\System\StorageManager\FATFS]
    		"Flags"=dword:00400001
    		"CacheSize"=dword:00000190 ; 0x190 (400) = 512kB
    		"Paging"=dword:00000001
    		"EnableCache"=dword:00000001
    		"FormatTFat"=dword:00000001
    		"FormatExfat"=dword:00000001
    		"Flags"=dword:00040028 ; FATFS_TRANS_DATA, FATFS_FORCE_WRITETHROUGH, FATFS_VERIFY_WRITES
        
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
    		"MountAsBootable"=dword:1

    Do you know if this settings are correct?

    Best regards,

    Andreas

    Tuesday, September 18, 2012 9:26 AM
  • Hi,

    Now I'm really sure, that I use TFAT filesystem on my NOR Flash, because I have used CeGetVolumeInfo() to check it.

    I have a test scenario implemented, in which files are written and deleted while the power supply is interrupted. With this test the filesystem is going to be corrupt after some powering off cycles. With this test data corruption is ok, but the FAT filesystem must not be corrupt.

    What's could be the problem? I use TFAT filesystem with the following registy settings:

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\StrataFMD]
       "Dll"="stratad.dll"
       "Order"=dword:2
       "Prefix"="DSK"
       "Ioctl"=dword:4
       "Profile"="MSFlash"
       "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
       "BootPhase"=dword:1
       "MemBase"=dword:1600000      ; Memory Range 22MB - 32MB
       "MemLen"=dword:A00000        ; FlashDisk Size: 10MB (minus 500kB for Filesystem)
       "BlockSize"=dword:20000      ; 128kB Blocks
       "WriteBufferSize"=dword:C    ; determined from CFI   
       "SectorSize"=dword:200       ; Software controlled value (512Byte)
       "IsPairedFlash"=dword:0      ; 16 bit Data-Bus width
       "Flags"=dword:1000
    ; Support XIP in IMGFS
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\IMGFS]
        "XIP"=dword:1
    ; Override names in default profile
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
        "Name"="MSFLASH for STRATAFLASH"
        "Folder"="NOR Flash"        ; Windows foldername
        "AutoMount"=dword:1
        "AutoPart"=dword:1
        "AutoFormat"=dword:1
        "MountFlags"=dword:2
        "DefaultFileSystem"="FATFS"
        "PartitionDriverName"="MSPART"
        "MountAsBootable"=dword:1
        "MountAsRoot"=dword:0
    [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\MSFlash]
        "DriverPath"="Drivers\\BuiltIn\\StrataFMD"
        ; LoadFlags 0x01 == load synchronously
        "LoadFlags"=dword:1
        "Paging"=dword:1
        "Order"=dword:0
        "BootPhase"=dword:0
     
    [HKEY_LOCAL_MACHINE\System\StorageManager\EXFAT]
    	"FormatTFat"=dword:00000001
    				
    [HKEY_LOCAL_MACHINE\System\StorageManager\FATFS]
    	"Flags"=dword:00400001
    	"CacheSize"=dword:00000190 ; 0x190 (400) = 512kB
    	"Paging"=dword:00000001
    	"EnableCache"=dword:00000000
    	"FormatTFat"=dword:00000001
    	"FormatExfat"=dword:00000001
    	"Flags"=dword:006C0038 ; FATFS_FORCE_TFAT, FATFS_TFAT_USECLUS1, FATFS_TRANS_DATA, FATFS_FORCE_WRITETHROUGH, FATFS_ENABLE_BACKUP_FAT, FATFS_VERIFY_WRITES 
        
        ; 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 toScanVolume.
        ;FATFS_VERIFY_WRITES 0x00000008 Verifies all writes.
        ;FATFS_ENABLE_BACKUP_FAT 0x00000010 Adds a backup FAT to allformats.
        ;FATFS_FORCE_WRITETHROUGH 0x00000020 Sets all files toWRITE_THROUGH, regardless of the parameters to CreateFile.
        ;FATFS_DISABLE_AUTOFORMAT 0x00000040 Disables automatic formattingof unformatted volumes.
        ;FATFS_WFWS_NOWRITETHRU 0x00010000 Disables write through on theWriteFileWithSeek 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 inthe FAT table for a TFAT transaction. TFAT uses the NOF field of theboot sector by default.
        ;FATFS_DISABLE_TFAT_REDIR 0x00100000 Disables the redirect of theroot directory to another hidden directory for FAT12 or 16.
        ;FATFS_TFAT_ALWAYS 0x00200000 Marks transaction status, even ifonly one sector in FAT is changed.
        ;FATFS_FORCE_TFAT 0x00400000 Forces TFAT transactions even if thevolume is not formatted as TFAT.
        ;FATFS_LFN_EXTENDED 0x00800000 Generate LFN entries for extendedcharacters always
        ;FATFS_TFAT_DISABLE_MOVEDIR 0x01000000 Disable movefile on adirectory for TFAT because it isn't transaction-safe    
        
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
    	"MountAsBootable"=dword:1
    	"MountAsRoot"=dword:0
        "MountFlags"=dword:2 

    Best regards,

    Andreas

    Thursday, September 20, 2012 7:37 AM