Mbed-os: NVSTORE - Initial configuration utility

Created on 17 May 2018  Â·  10Comments  Â·  Source: ARMmbed/mbed-os

Description

I am using the NVstore module to store parameters that should be available to the main application and the bootloader. One issue that comes up is the initial state of NVstore.

It would be useful to be able to statically initialize the NVstore with key/value pairs at compile time. This way, no additional steps are needed to deal with uninitialized NVstore values (no factory configuration, etc).

Issue request type

[ ] Question
[ X ] Enhancement
[ ] Bug

CLOSED storage mirrored

Most helpful comment

For me, Nvstore is used to store installed app header information (like version numbers, digital signatures, etc) along with a public key for verification, among other information.

For the sake of _clean code_, I don't want to duplicate this information and compile it into my binary. Therefore the application is unable to install its own application header or the public key at runtime. An issue arises when I want to do updates -- the installed application must verify the update and make sure it's not a downgrade. So pre-populating the NVstore would be useful for this case.

I have been able to write a standalone mbed program that just stores the data in Nvstore and then just save that section of the target's memory to a binary. I then merge this binary with my application after compiling and it accomplishes the same goal.

I can look at how NVstore formats data and maybe work on a utility. I just thought it might be a useful thing for the community to have.
[Mirrored to Jira]

All 10 comments

@davidsaada Please review
[Mirrored to Jira]

I'm not sure I understand the use case of compile time initialization. Can you explain?
Otherwise, initializing NVStore at run time is fairly easy: Just call reset API to clear NVStore, then use set calls to fill it with any key/value pairs you need.
[Mirrored to Jira]

For me, Nvstore is used to store installed app header information (like version numbers, digital signatures, etc) along with a public key for verification, among other information.

For the sake of _clean code_, I don't want to duplicate this information and compile it into my binary. Therefore the application is unable to install its own application header or the public key at runtime. An issue arises when I want to do updates -- the installed application must verify the update and make sure it's not a downgrade. So pre-populating the NVstore would be useful for this case.

I have been able to write a standalone mbed program that just stores the data in Nvstore and then just save that section of the target's memory to a binary. I then merge this binary with my application after compiling and it accomplishes the same goal.

I can look at how NVstore formats data and maybe work on a utility. I just thought it might be a useful thing for the community to have.
[Mirrored to Jira]

This is a valid feature request. Low priority for the moment
[Mirrored to Jira]

@AGlass0fMilk did you investigate the NVStore structure any further? If so, could you share your findings. I am in the same position as you are, see #7808
[Mirrored to Jira]

I haven’t had the chance to yet. It seems like it ought to be simple just by looking at Nvstore’s source though. Let me know if you figure anything out.

On Aug 16, 2018, at 11:31 AM, Bernhard Schuster <[email protected]notifications@github.com> wrote:

@AGlass0fMilkhttps://github.com/AGlass0fMilk did you investigate the NVStore structure any further? If so, could you share your findings. I am in the same position as you are, see #7808https://github.com/ARMmbed/mbed-os/issues/7808

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/ARMmbed/mbed-os/issues/6942#issuecomment-413586533, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAVZJEuf72GIuqu9o0p5FqfXmEaSdBk7ks5uRZBrgaJpZM4UDRms.

[Mirrored to Jira]

Is there any progress on it? Is there any other option than NVS where we can write the data(multiple file data) during flash of firmware and modify during run time? Using block device can we do that? We need to use the onboard flash and data writing in production environment.
[Mirrored to Jira]

cc @ARMmbed/mbed-os-storage
[Mirrored to Jira]

Internal Jira reference: https://jira.arm.com/browse/IOTSTOR-508

I'm closing the internal ticket, we are not going to work on this in the given time.
It can be considered as a future feature requests.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrissnow picture chrissnow  Â·  4Comments

bcostm picture bcostm  Â·  4Comments

pilotak picture pilotak  Â·  3Comments

MarceloSalazar picture MarceloSalazar  Â·  3Comments

neilt6 picture neilt6  Â·  4Comments