Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4.0 Flash Memory Usage

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    3

    Teensy 4.0 Flash Memory Usage

    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!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,400
    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.

  3. #3
    Junior Member
    Join Date
    Sep 2019
    Posts
    3
    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.....

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,400
    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.

  5. #5
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •