TS-4900 NVRAM: Difference between revisions

From embeddedTS Manuals
(Created page with "The RTC includes 128 bytes of NVRAM which can be used for custom applications. There is a utility, nvramctl which can be used to read/write the NVRAM. [https://github.com/em...")
 
No edit summary
Line 15: Line 15:


The NVRAM code can be included in your application by using these two files:
The NVRAM code can be included in your application by using these two files:
* [https://github.com/embeddedarm/ts4900-utils/blob/master/src/nvram.c]
* [https://github.com/embeddedarm/ts4900-utils/blob/master/src/nvram.c nvram.c]
* [https://github.com/embeddedarm/ts4900-utils/blob/master/src/nvram.h]
* [https://github.com/embeddedarm/ts4900-utils/blob/master/src/nvram.h nvram.h]

Revision as of 14:41, 31 July 2014

The RTC includes 128 bytes of NVRAM which can be used for custom applications. There is a utility, nvramctl which can be used to read/write the NVRAM.

ts4900-utils github.

This code can be included in your c/c++ application, or compiled as a standalone utility for access through other languages. The utility reads/writes a byte at a time, and returns the value in hex.

nvramctl --addr 10 --set 0x40
nvramctl --addr 10 --get
# Returns "nvram10=0x40".
# This can also be used with eval
eval $(nvramctl --addr 10 --get)
echo $nvram10
# Returns "0x40"

The NVRAM code can be included in your application by using these two files: