johnsondavies
New member
The file teensy4/avr/eeprom.h defines E2END which specifies how much emulated EEPROM is available:
In this earlier post @Branan said that on Teensy 4.0 the value of E2END can be increased up to a maximum of 0xEC6, giving 3783 bytes of EEPROM with reduced wear levelling:
https://forum.pjrc.com/threads/57377?p=214566&viewfull=1#post214566
I couldn't quite understand how he arrives at this figure; there's a test in avr/cores/teensy4/eeprom.c:
but that calculation gives a maximum of 255 x 15 - 1 or 3824 bytes, which is 41 more.
My question is: what is the largest value I can set E2END to on the Teensy 4.1 to get the maximum contiguous EEPROM?
Code:
#if defined(ARDUINO_TEENSY40)
#define E2END 0x437
#elif defined(ARDUINO_TEENSY41)
#define E2END 0x10BB
#endif
In this earlier post @Branan said that on Teensy 4.0 the value of E2END can be increased up to a maximum of 0xEC6, giving 3783 bytes of EEPROM with reduced wear levelling:
https://forum.pjrc.com/threads/57377?p=214566&viewfull=1#post214566
I couldn't quite understand how he arrives at this figure; there's a test in avr/cores/teensy4/eeprom.c:
Code:
#if E2END > (255*FLASH_SECTORS-1)
#error "E2END is set larger than the maximum possible EEPROM size"
#endif
but that calculation gives a maximum of 255 x 15 - 1 or 3824 bytes, which is 41 more.
My question is: what is the largest value I can set E2END to on the Teensy 4.1 to get the maximum contiguous EEPROM?