Go Down

Topic: EEPROM (Read 8858 times) previous topic - next topic

FernandoGarcia

Hello!

The DUE has a EEPROM ?

What is the capacity of it?

If not, is there another memory to replace it?

The library EEPROM.h is still valid?

Best regards.

Fernando Garcia

Conheça uma nova opção Open Source para controlar seu aquário: www.ferduino.com

Graynomad

No EEPROM but there is the ability with ARMs to do IAP (In Application Programming) which writes into flash. This could be used for non-volatile storage but someone will have to write the code. Maybe the Arduino guys have converted the EEPROM library to do this.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

Quote
Maybe the Arduino guys have converted the EEPROM library to do this.

It doesn't look like they have, I can't see any reference to a new EEPROM library and the old EEPROM.h file is the same as is always was. Maybe it's buried somewhere too obscure for my greps.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

cmaglie

Hi!

actually there is no EEPROM support on the Due.

Graynomad, i see some difficult to develop a drop-in replacement of EEPROM lib because:
- To modify a single byte of flash memory you are forced to rewrite an entire "page", (that is 256 bytes).
- Before writing a "page" of flash memory you need to erase it, so you should read temporary in RAM the old flash content, start erase, apply the changes in ram and finally write the updated page.

Said that, the idea of using the Flash memory is not bad, and using the EEFC device of SAM3X should be not too hard to create a simple FLASH library, maybe with a slightly different API from EEPROM that take in consideration the limits above.

C
C.

stimmer

IIRC the 16u2 has a small EEPROM, but to access that from the SAM3X it would need some special firmware and some means of communicating between the two.
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

pYro_65

Quote
- To modify a single byte of flash memory you are forced to rewrite an entire "page", (that is 256 bytes).
- Before writing a "page" of flash memory you need to erase it, so you should read temporary in RAM the old flash content, start erase, apply the changes in ram and finally write the updated page.


Hmm, one thing I'm considering for a project is a kind of pseudo virtual memory manager so I can safely use dynamic memory with only one allocation at app start. This 'IAP' could be some memory shortage fail safe when used for paging.

Can probably be used as a resource repository / registry. So many cool things I want to try.

FernandoGarcia

Hello!
Thanks for the replies.
Just do not understand how important things like this were not implemented before the release of the product.

Best regards.
Fernando Garcia
Conheça uma nova opção Open Source para controlar seu aquário: www.ferduino.com

sousoux


Just do not understand how important things like this were not implemented before the release of the product.


Because if everyone was satisfied before it released it never would. It's not difficult to write a EEPROM library that uses the flash. I'm already working on one.

Grumpy_Mike

Quote
Just do not understand how important things like this were not implemented before the release of the product.

Because the arduino is a development platform. However people seem to think that all trivial things should be presented as a library. There have been many years of unnecessary trivial function library development for the existing system, you can't expect that over night.

Dimdim

Hi there!

I just got my brand new Arduino Due and realized the hard way that the EEPROM library is no longer supported.

Are there any news on EEPROM-equivalent functionality being supported?

Thanx in advance! :)

m3741


Hi there!

I just got my brand new Arduino Due and realized the hard way that the EEPROM library is no longer supported.

Are there any news on EEPROM-equivalent functionality being supported?

Thanx in advance! :)


Better late than never? If you're willing to do a little hardware and software mod, you can utilize some EEPROM memory that is already on the board. See my post at http://forum.arduino.cc/index.php?topic=191298.0.

Enjoy!

sebnil

I have created a library for Arduino Due at https://github.com/sebnil/DueFlashStorage
The library is made to be similar to the EEPROM library. It will save non-volatile data but the flash storage is reset every time you upload a new sketch to your Arduino. Except for that exception it works the same as EEPROM for the older Arduinos. Remove power or press the reset button, the data will still be there.

Basic use:
Code: [Select]

// write the value 123 to address 0
dueFlashStorage.write(0,123);

// read byte at address 0
byte b = dueFlashStorage.read(0);


I hope you will find it useful.
http://sebastiannilsson.com

Horendus

Fantastic!

The in ability to save to a permanent  store on the DUE has always been its down fall in my eyes.

Ill be trying this out for a few projects soon :)

Question, there's 512KB of Flash on the DUE.
Does this library use the final (1kb? 2KB? 5KB?) for use with the library or do you define this during initialising of the sketch?

Collin80

Keep in mind that using flash memory for your storage is NOT permanent! Devices like the Due are meant to be programmed lots of times. Every single time you write a new sketch (or update your current one) it will erase the entirety of flash space including your stored stuff. There is no way around this. Sebnil mentioned this but I thought it good to reiterate this point strongly as it totally kills the usefulness for many people. If it still works fine for you then, by all means, have at it. Otherwise you might need to add an I2C connected EEPROM chip or follow m3741's link.


Fantastic!

The in ability to save to a permanent  store on the DUE has always been its down fall in my eyes.

Ill be trying this out for a few projects soon :)

Question, there's 512KB of Flash on the DUE.
Does this library use the final (1kb? 2KB? 5KB?) for use with the library or do you define this during initialising of the sketch?

MarkT

An I2C EEPROM chip on one of the I2C busses is one workaround.  Later
board revisions could incorporate one too?
[ I won't respond to messages, use the forum please ]

Go Up