How store data of an aplicattion in the non-volatile memory??

Hello all!!!

I’m working with software DIGI ESP FOR NET+OS 7.4 for me CONNNET ME with Jtag.

I created a website, but I need to store some data from my page in the non-volatile memory of my Connect ME.

I can store this data in NVRAM???
how can I store this data???

There is some example that stored some data private in the memory non- volatile???

Message was edited by: isaac

I’ve moved your question to a more appropriate forum to get it answered.

I’m working with the software DIGI ENG FOR NET + OS 7.4 for my Digi Connect ME with JTAG

I need create a project to change the configuration between DHCP and static IP of my CONNECT ME!

I have read several functions, but I can not analyze

you will have a sample project to change the configuration between DHCP and static IP?

HI,

I believe there are a couple of ways to do what you are trying to do.

The first is to go into the BSP and start to add fields to the BoardParams structure. This involves updating a number of files in the BSP and means that you need to ensure that the bootloader is updated each time you change anything.

The second an I believe simpler way is to simply define a number of structures to contain the data that you need and to then save them in the NV area using the NVRAM Drive API. This has a number of functions that help you out.

THe attached file is what I use for storing a few values that are used to set up my system. The structures will need to be modified to contain the data you need to store but the overall outline with my NVRCFG_Init() and NVRCFG_Save() functions should work for you.

Hope this helps

Roy

Roy’s ideas are good, but complex. Just save your parameters to a file. Unless you have disabled the filesystem of course.

The first way (adding to the devBoardParamsType structure in boardParams.h) is not really a way you’d want to go because you’re modifying the default NVRAM structure, and that could cause NVRAM corruption issues in the future (porting forward, for example, to a new NET+OS version).

The second way is good so long as the values you want to change aren’t changed that frequently. Keep in mind you’re writing to the NVRAM sector, and the way NOR flash works is to read it all into RAM, make the changes to the Flash sector, erase the sector, and then write it all back. If your user powers off the unit while it’s doing that, you will not only corrupt your settings, but those stored in the default NVRAM structure. I would say it’s ok if it’s being changed as much as your IP settings (which is stored in the default NVRAM structure).

A third method would to be to create a file in the Flash File System, and read/write to that. The up side is that if it gets corrupt, it at worst corrupts the file, or at best, the file system can recover and use the last file saved before the corruption. The down side is that you have to allocate a number of sectors of flash for this that may be more useful in application storage space.

thanks you rdeabill by the file that you send to me !!!

Message was edited by: isaac

Hello

I am including a root.c that I put together some time ago. I believe it does something close to what you want to do. Since I have had it around for a while I checked and all of the APIs and data structures used are described in the API reference guide. I'd advise you use it as a GUIDE only.

Good luck