Skip to content

List the MCUboot update image for an nRF52 build that also has a UF2 - #2852

Merged
bdraco merged 1 commit into
mainfrom
nrf52-list-mcuboot-update-image
Sep 27, 2026
Merged

bdraco merged 1 commit into
mainfrom
nrf52-list-mcuboot-update-image

Conversation

@bdraco

@bdraco bdraco commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

What does this implement/fix?

Lists zephyr/app_update.bin in firmware/get_binaries whenever it is on disk.

An nRF52 build with the mcumgr OTA chains MCUboot behind the Adafruit bootloader, so it produces a UF2 and the update image. ESPHome's get_download_types listed the image only when there is no UF2, so the frontend's MCUboot updates had nothing to download on those boards. That is fixed in esphome/esphome#19769, which is in dev and not in a release yet; this covers ESPHome 2026.9 and older.

Same approach as firmware.elf, which is already appended here.

Related issue or feature (if applicable):

  • n/a

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — docs
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Frontend coordination

Checklist

  • The code change is tested and works locally.
  • Pre-commit hooks pass (ruff, codespell, yaml/json/python checks).
  • Tests have been added or updated under tests/ where applicable.
  • components.index.json / definitions/components/*.json have not been hand-edited (regenerate via script/sync_components.py if a sync is needed).
  • Architecture-level changes are reflected in docs/ARCHITECTURE.md and/or docs/API.md.

An nRF52 build with the mcumgr OTA chains MCUboot behind the Adafruit bootloader, so it produces a UF2 and zephyr/app_update.bin. get_download_types lists the update image only when there is no UF2, which left the frontend's MCUboot updates with nothing to download.
@github-actions github-actions Bot added the bugfix Bug fix label Sep 27, 2026
@bdraco
bdraco marked this pull request as ready for review September 27, 2026 19:49
Copilot AI lite review requested due to automatic review settings September 27, 2026 19:49
@bdraco
bdraco marked this pull request as draft September 27, 2026 19:49
@codspeed

codspeed Bot commented Sep 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing nrf52-list-mcuboot-update-image (1830f7f) with main (4e1c866)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

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.

Copilot review overview

🟢 Approval recommended

Only nit-level documentation refinements remain, with no blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Adds MCUboot zephyr/app_update.bin to firmware downloads when present alongside UF2 artifacts.

Changes:

  • Discovers and deduplicates the MCUboot update image.
  • Adds coverage for presence, absence, and duplicate scenarios.
  • Documents the expanded firmware artifact list.
File Summary Final review comments
tests/​controllers/​firmware/​test_get_binaries.py Tests MCUboot artifact handling. Two nit comments (1 vote each): shorten docstrings to one-line behavior contracts.
esphome_device_builder/​controllers/​firmware/​download.py Discovers the MCUboot update image. One nit comment (1 vote): make the comment state the concise invariant.
docs/​API.md Documents the new downloadable artifact. None.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bdraco
bdraco marked this pull request as ready for review September 27, 2026 19:52
@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (4e1c866) to head (1830f7f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2852   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         295      295           
  Lines       25562    25565    +3     
=======================================
+ Hits        25500    25503    +3     
  Misses         62       62           
Flag Coverage Δ
py3.12 99.72% <100.00%> (+<0.01%) ⬆️
py3.14 99.60% <100.00%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...me_device_builder/controllers/firmware/download.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bdraco
bdraco merged commit 26f0dfe into main Sep 27, 2026
26 checks passed
@bdraco
bdraco deleted the nrf52-list-mcuboot-update-image branch September 27, 2026 19:53
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants