Skip to content

Conversation

@bigbrett
Copy link
Owner

@bigbrett bigbrett commented Jan 5, 2026

No description provided.

Copy link

Copilot AI left a comment

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 support for testing bootloader self-update functionality in the simulator environment. The self-update feature allows wolfBoot to update itself in RAM, which requires special handling in the simulator since flash memory is memory-mapped at runtime rather than at linker-time addresses.

Key changes:

  • Added simulator-specific self-update test that verifies the bootloader can update itself by swapping a dummy payload to the bootloader region
  • Implemented conditional logic in the self-update code to use runtime flash offsets instead of linker symbols when running in the simulator
  • Added arch_reboot() implementation for the simulator to properly exit after self-update

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tools/test.mk Adds test-sim-self-update target that creates a dummy bootloader update, assembles flash partitions, runs the simulator, and verifies the update was applied correctly
src/update_flash.c Adds ARCH_SIM conditional compilation to use ARCH_FLASH_OFFSET instead of _start_text linker symbol for flash writes in both EXT_FLASH and internal flash code paths
hal/sim.c Implements arch_reboot() function that calls exit(0) to terminate the simulator after self-update
config/examples/sim-self-update.config Provides configuration for simulator self-update testing with appropriate partition sizes and addresses
.github/workflows/test-sim-self-update.yml Adds CI workflow to automatically run the self-update test on ubuntu-latest with sources.list workaround for reliability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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