NVRAM connect wiem

Hello,

i use the NVRAM to save some data on my Digi Connect Wi-EM.

1/What is the size of the NVRAM ?
2/Maybe i should use th Flash Memory : what is the beginning and the end address of the Flash memory ?
When it is written 100,000 cycles of xriting, is it 100,000 of each writing not depending of the size of the writing (one character written or 2 characters written represents one writing or not?)
So a reading won’t be count as a cycle ?

3/I set the first location i write like this :

#define START_OF_FREE_NVRAM (START_OF_DEV_BOARD_PARAMETERS+sizeof (devBoardParamsType))

What i want to do is to write at each end of written data.
Then next time i will write at the end of what i wrote before.

4/I wanted to store a data that would be the last location, but i don’t know how to declare it, is it an int or a long int or a char ?

5/And the most important thing, what is the end’s location of the NVRAM ? Because when writing and reaching this end of NVRAM, i should come back to beginning and then erase the old data to write as a cycle.

6/If i write one characte, assume it is char data[0], does it take one location, and how “big” is it in memory ?

  1. The NVRAM, for the Connect platforms, is simply the last sector of the device’s flash, which on most platforms is 64kb. This can be adjusted from within the BSP.

  2. All flash devices guarantee a certain number of erase/write cycles. This is the number of time that one can erase and write to a particular bit of flash. This cycle expectancy is dependant on the particular flash component in use. For the Connect ME, with 2MB of flash this value is 1,000,000 (yes, one million) cycles. Presently for all other Connect platforms, with 4MB of flash) the expectancy is 100,000 cycles. Simply reading from flash has no impact on this expectancy.

  3. Are you trying to log data over a span of time? It might be best for you to enable the flash file system and store your data as a file, or files. The flash file system implements a wear-leveling algorithm, which will ensure that one particular portion of flash is not being over used.

  4. Your location is a bus address, thus an unsigned long (32 bits).

  5. The default configuration of most of our BSP’s is for the NVRAM to be located in the last sector of flash, therefore the end of NVRAM is the same as the end of flash, e.g. it depends on the amount of flash on that specific platform. For the Wi-EM, which possesses 4MB of flash the end of flash is (START_OF_DEV_BOARD_PARAMETERS + 65535). The location and overall size of the NVRAM space can be modified within the BSP. For the Wi-EM, with 4MB of flash, the end address is (BASE_ADDRESS + 0x400000) or (0x2000000 + 0x400000).

  6. 8 bits (1 byte).

Hello,

thank you very much for your answers ! This is really great !

But now i try, to be simple, to write and read in Flash Memory but it seems not to work by simply doing this :

char data[700];
int j = 0;

NAFlashWrite(0x2000000, 0, sizeof(data), data, ALWAYS_ERASE);

1/ What i try to do is to write at the beginning of the first free flash memory flash (is it 0x2000000 ?) an array of char data.

for (j = 0; j < 700; j++)
{
NAFlashRead(0x2000000, 0, sizeof(data), data[j]);
}

2/ Then i try to read it but i wondered if i can read all the array once and put it in an other array, or should i read each address at az time ?
Here i tried to read the entire array but no success.
I read that if i xanted to write or read the entire array, i should put zeros in the first two parameters of the 2 functions … It seems not to work …

3/Could you just show me an example using NAFlashWrite() and NAFlashRead() functions to show me how i can manage this ?

4/How long dos it take ? Is it depending on the size of the array ?

Some help would be welcome.

Many thanks.

Best regards.

Please take some time to review and understand the Flash API. The API document is provided as part of the development kit. Based on your example usage of the NAFlashWrite and NAFlashRead functions I get the distinct impression that you have either not read this documentation or do not understand it.

As to an example of the usage of this API, please refer to the naflash example provided with the development kit.

Additionally, this forum thread has certainly expanded beyond the specified scope of this forum. For continued assistance on this issue please submit an online support request via our support web site at: http://www.digi.com/support/eservice/eservicelogin.jsp.

Cameron

Hello,
i a m sorry, i know all that, but i try to make things work, so i asked some help after many tries, if you could answer to my questions it would be great …
I’ll try to contact the support as well.

Many thanks.

Best regards.

Message was edited by: global