Add option to persist boot/update failure info to flash#809
Draft
mattia-moffa wants to merge 3 commits into
Draft
Add option to persist boot/update failure info to flash#809mattia-moffa wants to merge 3 commits into
mattia-moffa wants to merge 3 commits into
Conversation
When boot/update partition verification fails during boot or update, with this option the event is logged to flash in an ad-hoc partition. Information about logged failures is made available to the application through an API.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional “persistent failure diagnostics” feature to wolfBoot: when enabled, boot/update/rollback verification failures are recorded to a dedicated flash region and made available to the application via a small read/clear API.
Changes:
- Add a flash-backed, circular log for failure records and expose read/clear APIs in
libwolfboot. - Record verification failures during update/boot and record rollback-not-confirmed events when rollback occurs.
- Add build options and document the new feature and API.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/update_flash.c | Records boot/update verification failures and rollback-not-confirmed events when diagnostics are enabled. |
| src/libwolfboot.c | Implements the on-flash diagnostics log format, scanning/ordering logic, and the public read/clear APIs. |
| options.mk | Adds build-time options/macros to enable diagnostics and configure the reserved flash region. |
| include/wolfboot/wolfboot.h | Defines failure phases/causes, the persisted record structure, and the new public API prototypes. |
| docs/API.md | Documents the new failure diagnostics feature and how applications consume the records. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When boot/update partition verification fails during boot or update, with this option the event is logged to flash in an ad-hoc partition. Information about logged failures is made available to the application through an API.
For a more detailed description see the changes to
docs/API.md.