Saturday, September 14, 2013

NVRAM usage in Emebedded System

Refer to: Non-volatile random-access memory

NVRAM can be replaced by SRAM with battery . 

In Linux, mostly NVRAM is statically mapped to memory space.

MTD partition is built on top of it, which can be used for sequential

reading/writing or block device simulation  for filesystem. 

To verify data integrity on NVRAM:

bash-3.2# flash_eraseall -j /dev/mtd3
Erasing 16 Kibyte @ 1fc000 -- 99 % complete. Cleanmarker written at 1fc000.

bash-3.2# mkdir /mnt/flash

bash-3.2# mount -t jffs2 /dev/mtdblock3 /mnt/flash

bash-3.2# ls -al test.img
-rw-rw-rw- 1 root root 262144 Jan  9 00:34 test.img
bash-3.2# cp test.img /mnt/flash/

bash-3.2# md5sum /mnt/flash/test.img
ec87a838931d4d5d2e94a04644788a55  /mnt/flash/test.img
 

No comments:

Post a Comment