Location of configuration parameters in EEPROM

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
JackJensen
Posts: 6
Joined: 02 Jun 2020 22:23

Location of configuration parameters in EEPROM

Post by JackJensen »

Hi,

I am trying to upload a default configuration to my Z-UNO Module based devices using restoreNVM, but I can not find any documentation on where in the EEPROM the values are placed.
I assume that they are placed in the 256B area between 0x2000 and 0x20FF, but as the 32 parameters only occupy 64 bytes I guess some of the is used for other purposes.
Could you please provide a map of the EEPROM layout?

Thanks,
Jack Jensen
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: Location of configuration parameters in EEPROM

Post by p0lyg0n1 »

Hi Jack,
1) You can restoreNVM and dumpNVM of EEPROM's "userspace" only. They use the same address area as EEPROM.get/EEPROM.read methods. So you can modify user area of EEPROM. You can't corrupt system area of EEPROM by means of this.
2) Yes, you are right: user configuration parameters occupy area between 0x2000 and 0x20FF. Area 0x2040.. 0x20FF is reserved now. It's not a problem if you fill this area with 0xFF value (EEPROM is filled with 0xFF from factory ).
3) More details about store of custom configuration parameters you can see here:
https://github.com/Z-Wave-Me/Z-Uno-Core ... e.cpp#L199
As you can note the code only calls to system function (ZUNO_FUNC_EEPROM_READ/ZUNO_FUNC_EEPROM_WRITE) and calculation of memory address based on parameter number. The same approach you can find in EEPROM.cpp (https://github.com/Z-Wave-Me/Z-Uno-Core ... ROM.cpp#L9)
4)
Could you please provide a map of the EEPROM layout?
We have only one specific area (for custom configuration parameters) in user's EEPROM that was described here
https://z-uno.z-wave.me/Reference/EEPROM/
System area is protected from usercode actions, every time zunoSysCall checks adresses when you call it. So user can't rewrite system variables directly. As I noted in 1) you can't harm systems space by means of restoreNVM too.
5) If you want to initialize not only configuration parameters, but you need some binary "resources" in your sketch you can use restoreNVM with previosly saved resource(s) in ".bin" file and right address(the same as you use in EEPROM.get/EEPROM.read methods in sketch for this resourse).
Hope I have answered to all your questions clear. ;-) Thank you for using our Z-Uno. Good luck!

Best regards,
Alex.
JackJensen
Posts: 6
Joined: 02 Jun 2020 22:23

Re: Location of configuration parameters in EEPROM

Post by JackJensen »

Hi Alex,

You answered my question and then some.

Thank you very much,
Jack
Post Reply