NVRAM Corruption Problem

Hello,
Since 2 weeks ago, I am getting this error when I am trying to access the NVRAM in Windows CE.

NVRAM: Original Critical is BAD
NVRAM: Mirror Critical is BAD
NVRAM: Original Flash is BAD
NVRAM: Mirror Flash is BAD
NVRAM: Original Flash and Mirror Flash don’t match
NVRAM: Original and Mirror don’t match
NVRAM: Original and Mirror Flash don’t match
NVRAM: No NVRAM contents usable
NVRAM: Resetting Workcopy
NVRAM: Repairing Original
NVRAM: Resetting Workcopy
Unable to initialize nvram

This problem doesn’t occur while I am in the uboot. I can read/write any environment variables in NVRAM from the u-boot. Also , the library nvram.lib can read the values saved in NVRAM and transfer them into registry.

I tried to erase all the NAND flash and reconfigured everything but I am still getting the same error.

Any Ideas?

Thanks

Can you please mention what are the modifications exactly have you done? You want to clear the nand flash from your application?

Thanks…

Hi,
I have a few additional environment variables that I am using for custom hardware configuration. Those variables can be changed when the device is booted up or from the u-boot.

I am using the command uboot_env.exe to list and change the values of the variables.

This error occurs simple by doing a dump of the variables with the command “uboot_env.exe -d”

I tried to erase all the nand to make sure that the backup copy of the NVRAM was recreated and valid. I did by using a j-tag and entering the command line “nand erase 0x0 0x8000000” .

I do not know what cause this problem to happen. The image is working very well on our 30 other devices.

There’s an NVRAM patch for WinCE that might solve your problem. I don’t know what module you have, so I just grabbed the link for the 9M, check it out.

http://www.digi.com/support/productdetl.jsp?pid=5025&osvid=140&tp=9&s=582&tp2=0

If the problem is not shown from U-Boot but only from WinCE, probably WindowCE uses different partition start/end values for NVRAM.

When you reset NVRAM from U-Boot and store all variables from U-Boot and you don’t get any such failure messages during next U-Boot reboot but you get them in WindowsCE, how does this match your sentence “nvram.lib can read the values saved in NVRAM”, because your error message says that you shouldn’t be able to read them, because the deteced CRC checksums are wrong.

The partition table in WinCE with start/end addresses, are these compiled or dynamically, read from NVRAM (for NVRAM they should be static) or taken from WinCE registry?

Do you have connected external devices to the data/addressbus which might concurrently try to access the adddress/databus while WinCE tries to read NVRAM from flash? Maybe a problem with the chip select signals of those devices or electrical interference (Emission input) on those chip select signals?

Does the problem occur on all of your devices or just one/some?

What does U-Boot command “nand bad” show?
Are there any bad block in the NVRAM partitions?
which are maybe skipped correctly by U-Boot but not by WinCE nvram.lib?