persistent data in flash?

Status
Not open for further replies.

BJB

Well-known member
Good People,

Back from the frozen tundra (Eastern U.S.), where (thanks to the hard work of the 'pjrc' people) the two teensy 3.1 PV monitors performed ok at various customers' sites.

Thinking about another project. Would need to be able to read/write about 38kbytes of non-volatile calibration constants, where the storage space size would not change (like a static array). Would like to do this in on-board flash, but do not see how without interfering with boot loader. Based on comments in this thread http://forum.pjrc.com/threads/24385-Flash-Teensy-3-0-from-sd-card, seems to be an ad-hoc and risky approach.

Is there a code library for the read and/or write of on-board flash, and have it available after each power-on cycle? Would rather not go the SD route. Thanks much.
 
There's a really clever wrapper for the EEPROM Anything library that lets you serialize and deserialize arbitrary C++ types by using templates. Very easy. For another example, my Didah project uses it.
 
Would like to do this in on-board flash, but do not see how without interfering with boot loader.

That should work fine, as long as you avoid writing to the first 2K of flash. But beware, if you ever writing to location 0x0000040C, you risk permanently bricking your Teensy 3.1.

It's also possible to write to use the EEPROM memory as 32K of low-endurance flash instead of 2K EEPROM, where the hardware is actually just incrementally writing to the 32K of real flash using wear leveling to make it look like 2K of EEPROM. But there currently isn't any code published to do this, so you'd need to roll your own....
 
Status
Not open for further replies.
Back
Top