This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need help with persistent registry

Hi Madhvi,

I follow your advice on the page http://e2e.ti.com/support/embedded/f/353/p/65181/237259.aspx#237259 to enable persistent registry but I encounter some problem and have difficulty to get it to work.

I created a debug build with persistent registry and during the image download, I see a lot of errors on the debug output as attached in this post.

5340.CEDebugLog.txt

After the boot completed, I no longer see the folder "Mounted Volume" in My Device as I had before enabling persistent registry.

I appreciate your help looking at what I did below to see if I am missing anything.  Thanks, Luan.

In my batch build file, I added

set IMGREGHIVE=1
if /i "%IMGREGHIVE%"=="1" set PRJ_ENABLE_FSREGHIVE=1
if /i "%IMGREGHIVE%"=="1" set PRJ_ENABLE_REGFLUSH_THREAD=1
if /i "%IMGREGHIVE%"=="1" set PRJ_ENABLE_FSMOUNTASROOT=1
if /i "%IMGREGHIVE%"=="1" set PRJ_BOOTDEVICE_MSFLASH=1

In the Catalog, I have the followings included:

RAM and ROM File System
exFAT File System
Hive-based Registry
FAT File System
Partition Driver

In platform.reg,

; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION

[HKEY_LOCAL_MACHINE\Init\BootVars]
    "Flags"=dword:3

IF IMGREGHIVE
[HKEY_LOCAL_MACHINE\init\BootVars]
    "SystemHive"="Documents and settings\\system.hv"      ; Set the location and name of the system hive file
    "ProfileDir"="Documents and settings"
    "Start DevMgr"=dword:1 ; Start storage manager in boot phase 1 for hive-based registry
ENDIF IMGREGHIVE


[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MSFlash]
    "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\MSFlash]
    "Flags"=dword:00010000

; @CESYSGEN ENDIF FILESYS_FSREGHIVE
;-------------------------------------------------------------------------------

;-- Storage Manager Configuration ----------------------------------------------
; @CESYSGEN IF CE_MODULES_FSDMGR
;
; HIVE BOOT SECTION

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
    "DriverPath"="Drivers\\BuiltIn\\MSFlash"
    "LoadFlags"=dword:1
IF IMGREGHIVE
    "BootPhase"=dword:1          ; Make NAND available in BootPhase1, to load the persisted registry
ELSE

    "BootPhase"=dword:0
ENDIF
    "Order"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
IF IMGREGHIVE
    "MountAsRoot"=dword:1
    "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

    "Flags"=dword:00000014
    "FormatTFAT"=dword:1
    "EnableWriteBack"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF CE_MODULES_FSDMGR

 

  • So why do you say it is not working?

    According to the debug log the persistent storage mounted just fine. You will not see a "Mounted Volume" as you have "MountAsRoot" set. With this set basically all folders under the root are persisted. Set MountAsRoot to "0" and you just get the "Mounted Volume" persisted I believe.

    Remember, depending on what version of the BSP you are using a "power on" reboot will force a "clean registry" boot. Only warm re-boots will NOT reset the registry but you can rework the start up and some of the flags if you actually want to persist registry across power cycles.