That mostly sounds good to me, though I agree that the need to duplicate
app code is not ideal.
Here is an alternative idea:
* Both fs and fcb export a suitable API (e.g., "bootapi").
* By default, apps depend on nffs.
* If a particular feature is set in the target, the app depends on
fcb instead.
Something like:
pkg.deps.base:
- libs/os
- sys/log
- libs/newtmgr
- libs/console/full
- libs/shell
pkg.deps: [pkg.deps.base, fs/nffs]
pkg.deps.FCB_BOOT.OVERWRITE: [pkg.deps.base, sys/config, sys/fcb]
I may have gotten the yaml syntax wrong, but I think the concept works.
Chris
On Thu, Apr 07, 2016 at 09:27:37AM -0700, marko kiiskila wrote:
> Hi,
>
> at the moment bootloader always uses NFFS. App can tell bootloader
> to pick specific image for next boot by creating a file. Bootloader also
> keeps track of image update by writing to another file.
>
> I want to use sys/config and FCB (flash circular buffer) for
> this instead. Reason for this change is the impact on code size.
>
> My current idea revolves around creating new versions of apps;
> one version uses NFFS and second version uses FCB. Both would
> go for the same flash map entry for location of their storage.
>
> And you would pick your target to use either NFFS or FCB depending on
> what platform you’re building for.
>
> Not too keen on this though, as it would require a bit of code
> duplication (main.c on boot/slinky/blinky).
>
> Better suggestions?