These "EEPROManything" type of libraries were useful years ago when the official library didn't have that functionality but these days using them is pointless.
After switching all eeprom requests from eepromanything to eeprom.h I got this error
Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\plutus\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\EEPROM\src/EEPROM.h: In function 'long& EEPROMClass::get<long>(int, long&) [clone .isra.6] [clone .constprop]':
C:\Users\plutus\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\EEPROM\src/EEPROM.h:135:5: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper.exe: fatal error: D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
d:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
problem is here in my code I defined address with byte not int because its within byte (0-255).
const byte eeprom_key = 180;
after changing to int compiled ok.
same if writing char array to eeprom if in for loop counter is declared as byte and I`m going to write 20chars compiler doesnt like that and want me to change counter variable from byte to int.
is this a bug?
havent problem like this with EEPROManything.h
same code with EEPROManything.h
Sketch uses 21590 bytes (66%) of program storage space. Maximum is 32256 bytes.
Global variables use 827 bytes (40%) of dynamic memory, leaving 1221 bytes for local variables. Maximum is 2048 bytes.
same code with EEPROM.h
Sketch uses 21670 bytes (67%) of program storage space. Maximum is 32256 bytes.
Global variables use 827 bytes (40%) of dynamic memory, leaving 1221 bytes for local variables. Maximum is 2048 bytes.
EEPROM library put and get are template functions. To match a template function, the parameters must match. The compiler should not crash on this. You can use byte variable, only add a cast before the use in put or get function for the compiler to match the template. EEPROM.put((int) eeprom_key, value)
The segmentation fault error is specific to the new avr-gcc 5.4.0 version used in Arduino IDE 1.8.6/Arduino AVR Boards 1.6.22:
Unfortunately there doesn't seem to be much progress on this issue so I suspect Arduino IDE 1.8.7/Arduino AVR Boards 1.6.23 will have the same problem. At least Arduino IDE 1.8.7 will allow us to roll back to the last good version of Arduino AVR Boards (1.6.21).