Teensy 4.0 Flash Memory Usage

Status
Not open for further replies.

cdavis2

Member
I see that the new Teensy 4.0 has 2 M of flash memory, but the system RAM is 1 M, and I'm never likely to have my program grow that large. Can I use a portion of the flash memory to store information that is needed by the program? I don't need a real file system, just a way to store and retrieve up to a megabyte of configuration information. This data would be updated infrequently, and typically just read once at power up or when requested by the system's user.

Any code sample for doing this would be appreciated, as I'm fairly new with Arduino and Teensy.

Thanks!
 
During programming all of the T4 FLASH is cleared, except the upper 64KB reserved for EEPROM and Restore code.

No data on the flash in the 'user area' would persist across program upload.
 
That would be OK in my app - once it is programmed, it won't be reprogrammed by the user, but I'd like to let them load configuration data into the unused flash area. I can add an external flash chip, but I figured since all this memory is sitting there, it would be nice to use it.....
 
There are perhaps usable examples of access in the T4_Beta thread - but given the vanishing nature of it there aren't up front plans noted about reserving any of that and giving an access method to it.

If something useful/compelling were created it might become a thing that could be worked into the bootloader for preservation in some fashion. May have been one passing note in Beta about a storage system - so it might be possible to make a persistent area - but first step perhaps would be the temporary use indicated made usable.
 
Would it be sufficient for your app @cdavis2 or possible technically @defragster to just expand the area reserved for EEPROM at the cost of some code space? Maybe use the ESP32 way of choosing memory maps for projects with different needs?
 
Status
Not open for further replies.
Back
Top