This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use all of available flash, using fstorage.

I need to store as much data as possible in flash.  And the free flash size varies from different version of the application software.

Is there a method to have the lowest priority fstorage allocation give you all of the unused flash from the top of the code up?  And not have to manually change a source allocation setting or a linker setting?

Parents
  • Minor problem: Firmware update could kill settings, when the newer firmware is sligthly bigger and needs an addidional flash sector.

  • I don't care about the data lost in the flash area.  And the point of my question was to not have to specify any build time settings that allocate this segment of the fstorage space.

Reply
  • I don't care about the data lost in the flash area.  And the point of my question was to not have to specify any build time settings that allocate this segment of the fstorage space.

Children
  • You can use fds, just define FDS_VIRTUAL_PAGES to a large number, and during fds_init() it will call pages_init() which will ignore pages that contain non-FDS data.

  • But doesn't that require FDS_PHY_PAGES to be set to some value?  I want to use for a given build, all the unused portion of flash pages.  

    Also I'm avoiding using FDS, because of the need to garbage collect.  And the wear leveling isn't that good for my application.

  • FDS_PHY_PAGES is calculated from FDS_VIRTUAL_PAGES. Using FDS in this case will do as you request; it will claim all unused pages.