PaulStoffregen
Well-known member
Have you tried the edit of E2END in eeprom.h, as suggested in msg #20?
For a little more detail, when you find that file, here is the code you'll see:
For Teensy LC, the default is 0x7F, meaning you get 128 bytes. The maximum you can change this into (and still expect it to actually work) is 0xFE, for 254 bytes.
All you have to do is find this file and edit it to change that number. Arduino will automatically notice the change and start using it for the next upload. Easy stuff.
Well, except perhaps finding this file. If you have a Macintosh, the trick is to control-click Arduino and "show package contexts". Then you can access inside Arduino. Look in Contents/Java/hardware/teensy/avr/cores/teensy3/avr for this file. If using Windows, the default install location is C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\avr. Don't let all those "avr" names fool you... they're only named "avr" for compatibility with the huge amount of software designed for Arduino that assumes all boards are AVR chips. If using Linux, hopefully you know where you extracted Arduino! Inside that folder, look for hardware/teensy/avr/cores/teensy3/avr.
You'll also see suggestions on this thread to edit EEPROM_SIZE in eeprom.c. That is unnecessary with the modern code. Long ago, the size was indeed controlled by EEPROM_SIZE. It still is internally, but the modern code automatically sets EEPROM_SIZE, based on what you configure with E2END. Here's what you'll find in eeprom.c.
If you do look at eeprom.c, please keep in mind this file has 2 sections. EEPROM is done very differently in Teensy LC than it is on the Teensy 3.x boards. Generally I would not recommend editing eeprom.c unless you have fairly advanced programming skills. Especially do not mess with the code having the comment "// with great power comes great responsibility...."
Editing eeprom.h to merely increase E2END is pretty simple. Just don't go over the maximum of 0xFE for Teensy LC. That's the most which can be supported using the existing EEPROM emulation code. Doing any more would require completely redesigning that code.
For a little more detail, when you find that file, here is the code you'll see:
Code:
#if defined(__MK20DX128__) || defined(__MK20DX256__)
#define E2END 0x7FF
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
#define E2END 0xFFF
#elif defined(__MKL26Z64__)
#define E2END 0x7F
#else
#define E2END 0
#endif
For Teensy LC, the default is 0x7F, meaning you get 128 bytes. The maximum you can change this into (and still expect it to actually work) is 0xFE, for 254 bytes.
All you have to do is find this file and edit it to change that number. Arduino will automatically notice the change and start using it for the next upload. Easy stuff.
Well, except perhaps finding this file. If you have a Macintosh, the trick is to control-click Arduino and "show package contexts". Then you can access inside Arduino. Look in Contents/Java/hardware/teensy/avr/cores/teensy3/avr for this file. If using Windows, the default install location is C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\avr. Don't let all those "avr" names fool you... they're only named "avr" for compatibility with the huge amount of software designed for Arduino that assumes all boards are AVR chips. If using Linux, hopefully you know where you extracted Arduino! Inside that folder, look for hardware/teensy/avr/cores/teensy3/avr.
You'll also see suggestions on this thread to edit EEPROM_SIZE in eeprom.c. That is unnecessary with the modern code. Long ago, the size was indeed controlled by EEPROM_SIZE. It still is internally, but the modern code automatically sets EEPROM_SIZE, based on what you configure with E2END. Here's what you'll find in eeprom.c.
Code:
#elif defined(KINETISL)
#define EEPROM_SIZE (E2END+1)
If you do look at eeprom.c, please keep in mind this file has 2 sections. EEPROM is done very differently in Teensy LC than it is on the Teensy 3.x boards. Generally I would not recommend editing eeprom.c unless you have fairly advanced programming skills. Especially do not mess with the code having the comment "// with great power comes great responsibility...."
Editing eeprom.h to merely increase E2END is pretty simple. Just don't go over the maximum of 0xFE for Teensy LC. That's the most which can be supported using the existing EEPROM emulation code. Doing any more would require completely redesigning that code.