fix: Force frozen rebuild and switch deploy to pyOCD.#379
Conversation
There was a problem hiding this comment.
Pull request overview
Forces MicroPython’s frozen_content.c to be regenerated on each firmware build to prevent stale frozen-module content when local driver sources are symlinked and timestamps don’t trigger rebuilds.
Changes:
- Remove
ports/stm32/build-$(BOARD)/frozen_content.cbefore invoking the STM32 build to force regeneration of frozen module content.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b286ce6 to
09aaed1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .PHONY: deploy | ||
| deploy: $(MPY_DIR) ## Flash firmware to the board via OpenOCD | ||
| deploy: deploy-pyocd ## Flash firmware (default: pyocd) | ||
|
|
||
| .PHONY: deploy-pyocd | ||
| deploy-pyocd: $(MPY_DIR) ## Flash firmware via pyOCD (CMSIS-DAP) | ||
| $(PYTHON) -m pyocd flash $(STM32_DIR)/build-$(BOARD)/firmware.elf --format elf |
There was a problem hiding this comment.
After switching make deploy to default to pyOCD, the docs are now out of sync: CONTRIBUTING.md still lists OpenOCD as a prerequisite for make deploy and says make deploy flashes via OpenOCD (see CONTRIBUTING.md:123 and :195). Please update the documentation to reflect the new default (deploy→pyOCD) and the OpenOCD compatibility target.
There was a problem hiding this comment.
Fixed in 291df8b: updated CONTRIBUTING.md to list pyOCD as the prerequisite for make deploy and added make deploy-openocd as the alternative.
## [0.16.2](v0.16.1...v0.16.2) (2026-04-13) ### Bug Fixes * Force frozen rebuild and switch deploy to pyOCD. ([#379](#379)) ([4004540](4004540))
|
🎉 This PR is included in version 0.16.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closes #348
Summary
Two changes to fix the firmware build and deploy workflow:
1. Force frozen module regeneration
Delete
frozen_content.cbefore each build to force MicroPython to regenerate it. This ensures that driver modifications are always included in the firmware, even when timestamps are stale due to the symlink.2. Switch default deploy to pyOCD
Replace OpenOCD with pyOCD as the default flash tool. pyOCD reliably detects the STeaMi board via CMSIS-DAP and flashes correctly, while OpenOCD has issues (#380).
New targets:
make deploy— alias fordeploy-pyocd(default)make deploy-pyocd— flash via pyOCDmake deploy-openocd— flash via OpenOCD (kept for compatibility)3. Install pyOCD via pip
Added
flashoptional dependency group in pyproject.toml withpyocd>=0.44.make installnow installs.[dev,test,flash].Verified
make firmware && make deploy— builds and flashes correctly via pyOCD