Skip to content

ESP32-style dedicated progress screen for STM32 self-update#566

Merged
hapaxx11 merged 5 commits into
hapaxx11:mainfrom
smgtoxa:FirmwareUPD_GUI_Fix
Jun 4, 2026
Merged

ESP32-style dedicated progress screen for STM32 self-update#566
hapaxx11 merged 5 commits into
hapaxx11:mainfrom
smgtoxa:FirmwareUPD_GUI_Fix

Conversation

@smgtoxa

@smgtoxa smgtoxa commented Jun 4, 2026

Copy link
Copy Markdown

Description

During a STM32 (Hapax) firmware self-update, the progress was drawn on top of
the menu
— an Update progress: NN % text line plus a bitmap slider strip in
an info box — while the ESP32 update (#555) already renders on a clean dedicated
screen.

This change gives the self-update the same treatment. When bl_flash_app()
starts, it draws a dedicated full-screen progress view:

       Firmware Update
  ──────────────────────
     Do not power off
           45%
  [████████░░░░░░░░░░]
  • The screen is cleared and a title + "Do not power off" hint are shown.
  • During the multi-second erase phase a centered "Erasing flash…" status is
    shown on the same dedicated screen (replacing the old hourglass overlay).
  • A clean framed progress bar (outline + fill) renders with a centered
    percentage, on its own screen — no menu underneath.
  • The bar redraws only when the integer percentage changes, so the flash
    chunks don't trigger a screen flush each and slow the update.
  • The completion dialog ("Update complete! / Device will reboot" / "Update
    failed!", press OK) is unchanged.

The progress-percentage math is extracted into a pure, host-testable helper
fw_update_progress_percent() (m1_csrc/m1_fw_progress.h).

fw_gui_progress_update() is intentionally left in place — it is still used by
the ESP32 backup-flash path (m1_esp32_fw_update.c); this change only stops the
STM32 self-update from using it.

Type of Change

  • New feature (non-breaking change which adds functionality)

Hardware Requirements

  • M1 Device: Main Board REV2.8R

Testing Environment

  • Toolchain: CMake + arm-none-eabi-gcc 14.2
  • Host tests: GCC + Unity (ctest)

How Has This Been Tested?

  • On-device, REV2.8R: ran a STM32 firmware self-update. The progress now
    renders on a clean dedicated screen (title + "Do not power off"), shows
    "Erasing flash…" during erase, then the framed bar fills smoothly, and the
    "Update complete!" reboot dialog appears at the end.
  • Host unit tests for the percentage helper (tests/test_fw_progress.c,
    7 cases: start=0, done=100, mid values, total=0 guard, remainder>total
    clamp, real image size). Full suite: 98/98 pass.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (changelog fragment)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

smgtoxa and others added 2 commits June 4, 2026 10:13
The Hapax STM32 self firmware-update still drew its progress over the menu
via fw_gui_progress_update() (an 'Update progress: NN %' text line + bitmap
slider strip), unlike the ESP32 update which got a clean dedicated screen.

bl_flash_app() now renders a full-screen view that mirrors the ESP32 one:
a cleared screen with a 'Firmware Update' title, a 'Do not power off'
warning, a centered 'Erasing flash...' status during the erase phase, and a
framed percentage bar that redraws only when the integer %% changes.

Progress math is extracted to fw_update_progress_percent() in the new pure
header m1_fw_progress.h (guards total==0, clamps remainder>total) with
regression tests in tests/test_fw_progress.c. fw_gui_progress_update() is
left intact — it is still used by the ESP32 backup-flash path.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread m1_csrc/m1_fw_update_bl.c
@hapaxx11 hapaxx11 merged commit 3ee75c8 into hapaxx11:main Jun 4, 2026
3 checks passed
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.

3 participants