Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retention subsystem #55125

Merged
merged 14 commits into from
Apr 24, 2023
Merged

Conversation

nordicjm
Copy link
Collaborator

@nordicjm nordicjm commented Feb 23, 2023

Adds a retention system which builds on top of retained memory drivers to allow partitioning of areas and data integrity with magic header prefixes and checksum of stored data.

@nordicjm nordicjm force-pushed the retention_subsys branch 2 times, most recently from 0b95ffa to 5602ccf Compare February 23, 2023 16:05
@zephyrbot zephyrbot added manifest manifest-mcuboot DNM This PR should not be merged (Do Not Merge) labels Feb 23, 2023
@zephyrbot
Copy link
Collaborator

zephyrbot commented Feb 23, 2023

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
mcuboot mcu-tools/mcuboot@5962433 mcu-tools/mcuboot#1629 mcu-tools/mcuboot#1629/files

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@nordicjm nordicjm force-pushed the retention_subsys branch 6 times, most recently from 825a50a to e6e0017 Compare February 28, 2023 14:15
@nordicjm nordicjm marked this pull request as ready for review March 3, 2023 10:01
@zephyrbot zephyrbot added Release Notes To be mentioned in the release notes area: DFU Device Firmware Upgrade area: Devicetree Binding PR modifies or adds a Device Tree binding area: Documentation area: Process labels Mar 3, 2023
nordicjm added 10 commits April 21, 2023 07:49
Adds a boot mode system which allows for redirecting the boot
target of a device depending upon the state of a retained value.

Signed-off-by: Jamie McCrae <[email protected]>
Adds a command which can be used to enter mcuboot's serial recovery
mode when the retention subsystem is enabled.

Signed-off-by: Jamie McCrae <[email protected]>
Deprecates setting GPREGRET to the reset reason as this has been
replaced with the boot mode retention subsystem for nRF51/nRF52.

Signed-off-by: Jamie McCrae <[email protected]>
Adds a note that the old behaviour of setting the GPREGRET register
to the parameter of sys_reboot() is no longer the default as the
boot mode interface has replaced it.

Signed-off-by: Jamie McCrae <[email protected]>
Adds documentation for the retention subsystem and boot mode
interface. Also marks the retention subsystem as experimental.

Signed-off-by: Jamie McCrae <[email protected]>
Adds a test that exercises the boot mode (retention subsystem)
feature to check that an application can successfully boot into
mcuboot's serial recovery mode.

Signed-off-by: Jamie McCrae <[email protected]>
Adds mcuboot Kconfig options to the ignore list as these are
defined in mcuboot but used in documentation and samples which
utilise sysbuild to build mcuboot.

Signed-off-by: Jamie McCrae <[email protected]>
Adds an optional Kconfig to disable use of mutexes in the retained
memory driver.

Signed-off-by: Jamie McCrae <[email protected]>
Adds an optional Kconfig to disable use of mutexes in the
retention subsystem.

Signed-off-by: Jamie McCrae <[email protected]>
Adds details on the newly introduced retention subsystem and boot
mode APIs to the release notes.

Signed-off-by: Jamie McCrae <[email protected]>
@nordicjm
Copy link
Collaborator Author

I successfully ran the tests on a DK, would it be worth for me to add some overlays with different retentions backends configurations? If I do this would you consider adding those commits to the PR ?

Once this is merged, sure, submit a PR to add support for more boards.

@nordicjm
Copy link
Collaborator Author

BTW: the data retention system is using offset and size properties in the compatible, these should be combined in a reg property.

Fixed

@Laczen
Copy link
Collaborator

Laczen commented Apr 21, 2023

BTW: the data retention system is using offset and size properties in the compatible, these should be combined in a reg property.

Fixed

Good, still missing the sample to show how multiple subsystems (independently) can enable/disable this functionality according to their needs.
If this is not possible or there are limitations it is important to understand this in the evaluation of the proposed PR.

@nordicjm
Copy link
Collaborator Author

BTW: the data retention system is using offset and size properties in the compatible, these should be combined in a reg property.

Fixed

Good, still missing the sample to show how multiple subsystems (independently) can enable/disable this functionality according to their needs. If this is not possible or there are limitations it is important to understand this in the evaluation of the proposed PR.

No different than flash partitions

@Laczen
Copy link
Collaborator

Laczen commented Apr 21, 2023

BTW: the data retention system is using offset and size properties in the compatible, these should be combined in a reg property.

Fixed

Good, still missing the sample to show how multiple subsystems (independently) can enable/disable this functionality according to their needs. If this is not possible or there are limitations it is important to understand this in the evaluation of the proposed PR.

No different than flash partitions

Flash partitions have a lot of limitations. There are afaik no subsystems that are making changes (e.g. inserting) to the flash partitions because it is error prone and not possible without prior knowledge. The only way that changes are applied is by deleting the complete partition layout and rebuilding it.
This is not modular at all and cannot be used by independent modules trying to use this.

So please again, show how to do it.

@carlescufi carlescufi requested review from gmarull, aaillet and wbober and removed request for wbober April 21, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.