Can you overwrite a preinitialized DAT value in the EEPROM copy of a spin program?
andrewsi
Posts: 59
I have a simple app that displays a text string which is pre-initialized in a DAT String buffer. The hardware in question doesn't have anything in the way of additional onboard EEPROM to store persistent program data in beyond the existing 32K program storage on the standard Propeller Proto Board.
This is just fine as long as you don't want to change the message very often, as then you can just recompile/re-download. However, I had this thought that if I knew the offset in memory of the text from the @ operator, I could potentially use that to rewrite the string in the EEPROM itself at will, without having to rewrite the entire app. Then it occurred to me that perhaps there is checksumming of the application during the boot process, or something like that, such that changing the string in the EEPROM would invalidate the integrity of the app and cause future boots to fail... Haven't tried it, but I was curious if anyone else had ever used this technique, or is using extra EEPROM (or RAM on a clock chip, or whatever) really mandatory for any non-volatile storage of data created after compilation?
(Obviously manipulating your program's storage has some inherent dangers from the perspective of robustness, but I'm willing to put up with that if there are no barriers to selective rewriting of the built-in EEPROM via I2C.)
This is just fine as long as you don't want to change the message very often, as then you can just recompile/re-download. However, I had this thought that if I knew the offset in memory of the text from the @ operator, I could potentially use that to rewrite the string in the EEPROM itself at will, without having to rewrite the entire app. Then it occurred to me that perhaps there is checksumming of the application during the boot process, or something like that, such that changing the string in the EEPROM would invalidate the integrity of the app and cause future boots to fail... Haven't tried it, but I was curious if anyone else had ever used this technique, or is using extra EEPROM (or RAM on a clock chip, or whatever) really mandatory for any non-volatile storage of data created after compilation?
(Obviously manipulating your program's storage has some inherent dangers from the perspective of robustness, but I'm willing to put up with that if there are no barriers to selective rewriting of the built-in EEPROM via I2C.)
Comments
Depending on the program, the biggest problem could be that you loose the actual settings when writing a newer software-version to EEPROM.
If you write to EEPROM very frequently, you could also think about replacing the EEPROM with a FRAM. FRAMs have much more R/W cycles. And when you're at it, you can also replace it with a 64k version ;o)
Thanks for the confirmation!
http://forums.parallax.com/showthread.php?97625-PE-Kit-Lab-Applications-%96-EEPROM-Datalogging-and-I2C