Storing data on eeprom

Hi
I have a project I am working on that needs to have data stored on the eeprom, some of the data changed and some data altered in upgrades.

I have no problem in altering the data while the program is running my problem is pre-loading data and updating data with software updates.

Can the eeprom have data stored on it by the arduino IDE.
kendrick

There was some effort to make it possible to do this via the Arduino IDE 2.5 years ago but it never ended up being accepted:

It also may be that the bootloader on the board doesn't support writing to EEPROM. I believe support for this is now in Optiboot, but is not in the Optiboot version shipped with Arduino boards. I'm not sure about the other bootloaders.

You might be able to get better answers if you tell us which board you're using.

No.

But setup() in your program can look at the EEPROM and pre-load the initial default values if there are none there already. Remember any uninitialized byte will have the value 255.

Can't you write EEPROM directly form a file with AVRDude?

if you put data into the eeprom with one program will it stay there when another program is loaded.

I'm using a arduino mega 2560 pro.
is there any way to transfer data from the computer via a usb link.

write a function that reads data from the usb port and stores it in the eeprom. once working it can be embedded in the end program only to be called when updating.
kendrick

is there any way to transfer data from the computer via a usb link.

Ever use Serial?

Still, for what you describe I think you should look at using AVRDude from the command line.

Can't you write EEPROM directly form a file with AVRDude?

Only if the bootloader supports it. This feature was left out of Optiboot in order to get it to fit in the 0.5 kB boot section. I believe with the new version of Optiboot they managed to fit it in but maybe it doesn't fit in combination with the flash write feature. Since I didn't previously know which board Kendrick was using, I was hesitant to get into the avrdude thing. Now we know that Kendrick is using a Mega and I believe that avrdude writing .eep files is supported with the stock stk500v2 bootloader used on the Mega.

Kendrick:
if you put data into the eeprom with one program will it stay there when another program is loaded.

Yes, if you're writing to EEPROM via your sketch. However, I'm not sure what happens when you write to EEPROM using avrdude because I've never tried it. It would be cool if it only wrote to specific EEPROM addresses, but from the comment Add support to use AVR dude to upload .eep files on sketch upload by fulda1 · Pull Request #4963 · arduino/Arduino · GitHub it sounds like it might just overwrite the whole EEPROM.

pert:
Only if the bootloader supports it. This feature was left out of Optiboot in order to get it to fit in the 0.5 kB boot section. I believe with the new version of Optiboot they managed to fit it in but maybe it doesn't fit in combination with the flash write feature. Since I didn't previously know which board Kendrick was using, I was hesitant to get into the avrdude thing. Now we know that Kendrick is using a Mega and I believe that avrdude writing .eep files is supported with the stock stk500v2 bootloader used on the Mega.

OK that's the part I didn't know. I knew that AVRDude would do it but I didn't know how the Arduino would react. Usually I'm programming without the bootloader these days.