Skip to content

Add option to persist boot/update failure info to flash#809

Draft
mattia-moffa wants to merge 3 commits into
wolfSSL:masterfrom
mattia-moffa:20260626-failure-diagnostics
Draft

Add option to persist boot/update failure info to flash#809
mattia-moffa wants to merge 3 commits into
wolfSSL:masterfrom
mattia-moffa:20260626-failure-diagnostics

Conversation

@mattia-moffa

Copy link
Copy Markdown
Member

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.

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.
@mattia-moffa mattia-moffa self-assigned this Jun 26, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/libwolfboot.c Outdated
Comment thread src/libwolfboot.c Outdated
Comment thread src/libwolfboot.c
Comment thread docs/API.md
Comment thread src/libwolfboot.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants