Can FlexNVM be used for additional program flash?

ratnin

Member
I have an existing Teensy 3.2 based project that has been regularly updated over the past couple years to add an ever increasing list of features/capabilities. The constant stream of updates have steadily increased the size of the firmware image and has now reached a point where it's consuming 90-95% of the Teensy's available program flash. I've already picked all the low hanging fruit to get the compiled program size down (-Os, removing debug/redundant/dead code, trimming down libraries, etc) so any further decreases at this point will be much more involved and time consuming. The project roadmap is to transition to the Teensy 3.5 in the future with it's stronger hardware and deeper memory resources. However, due to the ongoing 3.5 availability issues I need to delay the hardware change and continue with our existing 3.2 based hardware for the time being. In an effort to squeeze some additional product life out of our Teensy 3.2 design without having to completely halt firmware development (ie. new features) I have to either A) decrease the size of the firmware image to fit within the available program flash or B) increase the useable size of the available program flash to accomodate a larger firmware image.

I know that option B is the road less travelled but I wanted to at least explore it because the Teensy's FlexNVM/FlexRAM architecture with is configurable and allows for on-chip memory to be partitioned in different ways to suit development needs. In my application the "EEPROM" sees very little use - maybe 20 bytes of "EEPROM" are used and those values are essentially static. So those 2K of "EEPROM" storage are unneeded along with the 32K of FlexNVM/RAM set aside for wear leveling. Could any part of this 32K be partitioned for use as additional flash storage for program code?

Thanks for any input!
 
I've never tried to use the FlexNVM partition feature on Teensy 3.2. But according to the documentation on page 572 in the manual, it should be possible to dedicate 16K to EEPROM and use the other half as flash. Theoretically, that should give you another 16K flash at 1000'0000 to 1000'3FFF. You'll need to edit eeprom_initialize() in eeprom.c to do the FlexNVM partition. Teensy's bootloader doesn't know anything about that memory, so you'll be on your own write your code into that space.
 
Back
Top