Loading data into EEPROM, Teensy 4.0

My application relies on configuration data residing in the CPU EEPROM. Is there a way that I can load it to the target directly through the IDE, rather than having to write code a both ends? The source data currently resides in a binary file, but that is flexible. Thanks for any info.
 
The short answer is I'm not aware of any way to write EEPROM data from the IDE. In my TeensyMIDIPolySynth project, I use EEPROM to allow the operator to easily store/update/recall 16 synth configuration slots. I store a checksum with each config slot. At startup, I test read each config slot. When reading, if the checksum fails, I overwrite that config slot with a default set of config data. That way, each configuration slot in EEPROM is always valid, and the system is self-healing (and self initializing upon first boot of a fresh Teensy).

Hope that helps...

Mark J Culross
KD5RXT
 
One low tech solution is to just use the micro SD card in the Teensy 4.1 (or solder in a micro SD card reader in the Teensy 4.0), and put a small micro SD card in the Teensy. When you want to transfer data, take out the micro SD card and put it in a reader on your computer.

While it doesn't match the requirement of using the IDE to transfer configuration data, you might incorporate MTP in your program. What this does is provide USB removable drive from your Teensy that you can copy files to/from your host system. This way, you just write the file on the Teensy in whatever format you want to one of the filesystems, and you can access it from the host.

I've only used with Linux computers (using the file explorer to access the MTP file system). I vaguely recall there are some Mac issues, but I don't recall what they are. Note, MTP is not in the PJRC sources, you would need to download support libraries either from WMXZ (which I use) or KurtE:
With MTP, the Teensy can export the following file systems:
  • Filesystem made out of the extra flash memory in the Teensy (~7 megabytes on Teensy 4.1, ~1 megabytes in Teensy 4.0). I don't recall if flashing a new program resets the filesystem in the left over flash memory or not. The advantage of using this extra flash memory is you don't have to add any extra hardware to the Teensy.
  • 8 megabytes of volatile PSRam flash soldered to the Teensy 4.1. Note PSRam is not preserved across reboots. If you don't have non-volatile flash memory soldered on the Teensy 4.1, you can solder 2 PSRam chips to the Teensy 4.1. Normally, PSRam just acts as normal memory, but you can create a filesystem in it if desired.
  • 16 megabytes of non-volatile NOR flash memory soldered to the Teensy 4.1.
  • 128-256 megabytes of non-volatile NAND flash memory soldered to the Teensy 4.1.
  • Micro SD card on the Teensy 4.1 (or 4.0 if you solder in a micro SD card).
  • Micro SD card on the revision D/D2 audio adapter on the Teensy 4.0/4.1.
  • Non-volatile NOR flash memory soldered to the revision D/D2 audio adapter on the Teensy 4.0/4.1.
  • External SPI flash memory/FRAM added to the Teensy.
  • External micro SD card drives added to the Teensy.
  • I don't know if it is possible, but you might be able to enable USB host support on the Teensy 4.1, and then export any USB drives that you attach to the Teensy.
If you are solder challenged, you can order Teensy 4.1s from the following place with PSRam and/or flash memory chips soldered on:
 
Last edited:
Back
Top