none
[Solved] Hive based registry is not presist after second reboot. RRS feed

  • Question

  • Dear Friends,

    I want that my data should be saved and for this reason I have enabled Hive based Registry. And i build successfully. After inserting the images I created one folder under Mounted_label and reboot the system. After rebooting I am able to see the same folder under same location... But after second boot the folder was dis-appears which means I am loosing my data....

    There corresponding .reg values in NAND seems correct to me.

    [HKEY_LOCAL_MACHINE\Init\BootVars]
        "Flags"=dword:3
    
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDisk]
        "Flags"=dword:00011000  ; load driver in boot phase 1; do not load again later
    
    ; END HIVE BOOT SECTION
    ; @CESYSGEN ELSE
    
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDisk]
        "Flags"=dword:00010000
    
    ; @CESYSGEN ENDIF FILESYS_FSREGHIVE
    ;-------------------------------------------------------------------------------
    
    ; @CESYSGEN IF CE_MODULES_FSDMGR
    ; HIVE BOOT SECTION
    Still I am losing the data .... Any one can help me to figure out the problem??????


    Monday, June 2, 2014 9:29 AM

Answers

  • Dear Friends,

    The above .reg entries are very much fine.. And the documents that i have studied was also correct. But, still I was confused why it's not working with us........

    SO, the problem is that we have to take care of NAND strcuture in bspcfg.c

    NAND_INFO SupportedNands[] = {
    {
            // MT29F4G08
            0x2C,   //manufacturerId
            0xF1,   //deviceId
            1024,   //blocks  
            64,     //sectorsPerBlock 
            2048,   //sectorSize - pageSize
            2       //wordData
        }
    };

    Here, I copied this entry from the previous structure entry where the block size is 4096... So, the folder or data what I was storing it might be out of NAND range and that's why, it was not persist.According to 4098, the NAND memory size goes to 512MB and the data was not persist..........

    ~Thanks for your valuable reply................

    Friday, June 6, 2014 5:10 AM

All replies

  • Did you rebuild after turning on hive?  This is a must do.

    You will also need to set the environment variable PRJ_ENABLE_FSREGHIVE.  This a a horrible backward compatibility thing from Microsoft, but necessary if you don't use mount as root.


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Monday, June 2, 2014 4:39 PM
    Moderator
  • Hello Friends,

     @Bruce Eitman Sir, 

     Yes, I have done build many times but no success and also corresponding variables are selected in catalog items and I manually added these variables under Environment section. But, still the output is same. Very first time it boots properly and when i created folder under mounted device and reboot it again, I found it there and after second boot it disappears . But, One thing I have observed after creating the folder and rebooting the device does not ask for calibration test and in this case the folder was there and after second boot, the device asks for calibration test and created folder disappears .....

    But, still no success .....?????????????
    Tuesday, June 3, 2014 2:47 AM
  • also you must need to set

    set PRJ_ENABLE_REGFLUSH_THREAD=1

    to enable flushing of registry from ram to your persistent memory


    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    Vinoth.R

    http://vinoth-vinothblog.blogspot.com
    http://www.e-consystems.com/windowsce.asp

    Tuesday, June 3, 2014 6:10 AM
  • Hello Friends,

    @Vinoth Sir,

    I have also done this thing but still its not working.....Now, the status is that after alternate booting, if i add any folder it exists and disappears in next boot...

    Please have look of enabled variables

    Enabled variables settingsWhat is missing now????

    I am also sharing .reg files for NAND

    IF BSP_NAND
    ; HIVE BOOT SECTION
    ;
    ; We want start both storage and device manager. Flags value is combination of
    ;   0x0001  Start storage manager in boot phases 0 and 1 to load the boot
    ;           file system.
    ;   0x0002  Start device manager in boot phase 1 to load the boot file system.
    ;
    [HKEY_LOCAL_MACHINE\Init\BootVars]
        "Flags"=dword:3
    	"SystemHive"="Documents and Settings\\system.hv"
    	"ProfileDir"="system.hv"
    	"DefaultUser"="User"
    	"RegPersisted"=dword:1
    	"RegistryFlags"=dword:1
    	
    	
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDisk]
        "Flags"=dword:00011000  ; load driver in boot phase 1; do not load again later
    
    ; END HIVE BOOT SECTION
    ; @CESYSGEN ELSE
    
    ;[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDisk]
        "Flags"=dword:00010000
    
    ; @CESYSGEN ENDIF FILESYS_FSREGHIVE
    ;-------------------------------------------------------------------------------
    
    ; @CESYSGEN IF CE_MODULES_FSDMGR
    ; HIVE BOOT SECTION
    
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
        "DisableAutoScan"=dword:1
        "FormatNumberOfFats"=dword:2        
        "Flags"=dword:14
        "EnableWriteBack"=dword:1
        "FormatTFAT"=dword:1
    IF IMGREGHIVE
        "MountAsRoot"=dword:0
        "MountAsBootable"=dword:1     
        "MountPermanent"=dword:1     ; Do not allow un-mounting (else we'd fail to flush the registry)
        "MountAsROM"=dword:0
        "MountHidden"=dword:0
        "CheckForFormat"=dword:1     ; Ask the OAL if we should format on boot (i.e. cold reset)
    ENDIF IMGREGHIVE
    
    IF IMGREGHIVE
    ; @CESYSGEN IF CE_MODULES_FSREPLXFILT
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS\Filters\fsreplxfilt]
        "dll"="fsreplxfilt.dll"
        "Order"=dword:$(FLT_LOAD_ORDER_NAND_HIVE)
    ; @CESYSGEN ENDIF CE_MODULES_FSREPLXFILT
    ENDIF IMGREGHIVE
    
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk]
       "DriverPath"="Drivers\\BuiltIn\\FlashDisk"
       "LoadFlags"=dword:1
    IF IMGREGHIVE
       "BootPhase"=dword:1          ; Make NAND available in BootPhase1, to load the persisted registry
    ELSE
       "BootPhase"=dword:0
    ENDIF IMGREGHIVE
       "Order"=dword:$(FSD_LOAD_ORDER_NAND)
       "AutoMount"=dword:1
       "AutoPart"=dword:0
       "AutoFormat"=dword:0
       "DefaultFileSystem"="FATFS"
       "PartitionDriver"="mspart.dll"
       "Folder"="Partap_Disk"
       ;PARTAP
    
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDisk]
        "Dll"="am33x_nand.dll"
        "Prefix"="DSK"
        "Index"=dword:1
        "Order"=dword:$(LOAD_ORDER_NAND)
        ;CNC Verify these, use #define
        "MemBase"=multi_sz:"50000000","08000000"
        "MemLen"=multi_sz:"00001000","00001000"
        ;"DmaCh"=dword:3
        ; CE_DRIVER_BLOCK_GUID
        "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
        "Profile"="FlashDisk"
        "Prefetch"=dword:1
    
    ; END HIVE BOOT SECTION
    ENDIF BSP_NAND
    ; @CESYSGEN ENDIF CE_MODULES_FSDMGR
    

    Tuesday, June 3, 2014 6:44 AM
  • I have enabled the following environment variables:-

    prj_enable_fsreghive = 1
    prj_enable_regflush_thread = 1
    IMGREGHIVE = 1
    SYSGEN_FSREGHIVE = 1

    And the mentioned .reg settings but after alternate boot I lost my data.

    Means before any alternate boot I add some folder and I can see in next boot and add one more folder and unable to see in next boot. 

    NOTE- Observed one thing when the data/folder persist in the desired location(mounted device).. that time device does not ask for calibration test ..

    I have also read various documents as shown below but still get no success:-

    http://processors.wiki.ti.com/index.php/Persistent_Registry_in_ARM-A8_BSP

    http://msdn.microsoft.com/en-us/library/ms892395.aspx

    http://stackoverflow.com/questions/2696941/hive-based-registry-in-flash

    What is missing I am very much confuse about this????? Please help me if any one worked in this kind of task ....


    Tuesday, June 3, 2014 10:24 AM
  • Hello Friends,

    After spending long time on it, it seems that all settings are very much fine and its kind of a bug that difficult to solve because in even boot I the value is persist what I saved in odd boot. Now, I have seen various documents, forums etc etc but after following the instruction the output is same. I have also followed the TI document  from the link which i had shared in the previous post and as -

    Persistent Registry in ARM-A8 BSP

    Now, it seems that no one has practical work on it. form theory point of view it seems okay but practical point of view it is totally different. But, I would like to say thanks again for your valuable support and spending your important time..

    If in future any one got the answer then plz update me so that I can solve my issue and others can also get the benefit of this .....


    Wednesday, June 4, 2014 3:56 AM
  • Dear Friends,

    The above .reg entries are very much fine.. And the documents that i have studied was also correct. But, still I was confused why it's not working with us........

    SO, the problem is that we have to take care of NAND strcuture in bspcfg.c

    NAND_INFO SupportedNands[] = {
    {
            // MT29F4G08
            0x2C,   //manufacturerId
            0xF1,   //deviceId
            1024,   //blocks  
            64,     //sectorsPerBlock 
            2048,   //sectorSize - pageSize
            2       //wordData
        }
    };

    Here, I copied this entry from the previous structure entry where the block size is 4096... So, the folder or data what I was storing it might be out of NAND range and that's why, it was not persist.According to 4098, the NAND memory size goes to 512MB and the data was not persist..........

    ~Thanks for your valuable reply................

    Friday, June 6, 2014 5:10 AM