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

Pre-load data in FDS, cloning devices

Hi everyone,

I am currently working on a project that leads me to save a respectful amount of data. Some of the objects that I save size a few KB actually.

I would like to use FDS all the time to manage them even though I need to start with initial values and I would like those initial values not being part of the application to save a maximum of space.

Question is : is it a good idea to "clone" my file system from device to device?

What I envision is having one specific application that would create my whole file system in FDS, then dump the FDS pages into a hex file and then use this hex file as one of the other hex files I am loading onto my devices that have the normal application.

Do you see any issue with this solution?

Thank you for your help!

  • Well, I was wondering if this kind of trick can be also played during a DFU sequence. Say I have one device in the field, it has been initiated with the Hex file of the FDS portion. Now my application changed and I have new files to add to the existing file system. Let us say I agree to loose user data during DFU, will it be possible for me to flash the FDS section again on the field? Or am I again stuck with init values being part of the app and then create files in FDS using code?

  • By modifying the bootloader it should be possible, but it is difficult to say how much work it would take.

    Without modifying the bootloader, it might be possible. The bootloader expects to get one application hex file, but you can try to merge the application hex with the FDS hex, in to one "application hex". Typically Fstorage (used by FDS) uses the last pages of flash (or the last pages of flash before the bootloader if it exists), but this isn't a good idea if you want to do dual bank update. Instead you should configure Fstorage to use the pages that are just after the application, or at least below the limit for doing dual bank update. Or you could just do single bank update.

Related