-
Notifications
You must be signed in to change notification settings - Fork 1
tooling: Add firmware build and deploy targets. #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3bc8e16
b667072
a3dfae2
5b85f45
95028ee
94a2d0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -79,6 +79,42 @@ ci: lint test test-examples ## Run all CI checks (lint + tests + examples) | |||||||||||||||||
| .PHONY: build | ||||||||||||||||||
| build: lint test ## Build (lint + test) | ||||||||||||||||||
|
|
||||||||||||||||||
| # --- Firmware --- | ||||||||||||||||||
|
|
||||||||||||||||||
| $(MPY_DIR): | ||||||||||||||||||
|
||||||||||||||||||
| $(MPY_DIR): | |
| $(MPY_DIR): | |
| @mkdir -p $(dir $(MPY_DIR)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 95028ee. Added mkdir -p before clone.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “update submodule to current HEAD” logic is unlikely to work for local/unpushed commits: the submodule fetches only from its own origin, then tries to checkout a SHA from the parent repo. If that SHA isn’t present in the submodule clone, this will fail and it also won’t include uncommitted local changes. Consider fetching from the local working tree path (or setting the submodule URL to the local repo) and clarify whether users must commit changes before building firmware.
| @echo "Updating submodule to current HEAD..." | |
| cd $(MPY_DIR)/lib/micropython-steami-lib && \ | |
| git fetch origin && \ | |
| git checkout $$(cd $(CURDIR) && git rev-parse HEAD) | |
| @echo "Updating submodule to current committed HEAD from local repo (uncommitted changes are not included)..." | |
| cd $(MPY_DIR)/lib/micropython-steami-lib && \ | |
| git fetch "$(CURDIR)" HEAD && \ | |
| git checkout FETCH_HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 95028ee. Replaced git fetch origin with a symlink: rm -rf ... && ln -s $(CURDIR) .... This way the firmware includes all local changes — even uncommitted ones — without needing to fetch or push.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deploy assumes $(MPY_DIR) already exists; running make deploy in a clean repo will fail because the clone hasn’t happened yet. Make deploy depend on $(MPY_DIR) (and likely firmware if you expect a freshly built hex) so it works from a fresh checkout.
| deploy: ## Flash firmware to the board via OpenOCD | |
| deploy: firmware ## Flash firmware to the board via OpenOCD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 95028ee. deploy now depends on $(MPY_DIR) — ensures the clone exists but doesn't force a rebuild. Use make firmware deploy for a full build+flash.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot
AI
Mar 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .ONESHELL mode, prefer quoting $(BUILD_DIR) in rm -rf (and you can usually drop the -d guard since rm -rf is already idempotent). Unquoted paths can behave unexpectedly if the variable is overridden with spaces or glob characters.
| @if [ -d "$(BUILD_DIR)" ]; then rm -rf $(BUILD_DIR); fi | |
| rm -rf "$(BUILD_DIR)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 95028ee. Quoted $(BUILD_DIR) in rm -rf.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| export PATH := $(CURDIR)/node_modules/.bin:$(PATH) | ||
| PORT ?= /dev/ttyACM0 | ||
|
|
||
| # Firmware build configuration | ||
| MICROPYTHON_REPO ?= https://github.com/steamicc/micropython-steami.git | ||
| MICROPYTHON_BRANCH ?= stm32-steami-rev1d-final | ||
| BOARD ?= STEAM32_WB55RG | ||
| BUILD_DIR ?= .build | ||
| MPY_DIR ?= $(BUILD_DIR)/micropython-steami |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say the firmware submodule is pointed to “the current HEAD of your local branch” and list requirements only as GCC + OpenOCD, but the Makefile currently fetches from the submodule’s
origin(so local/unpushed commits won’t be available) andmake runrequiresmpremoteto be installed. Please align this section with the actual behavior and listmpremoteas a requirement fordeploy/run.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 95028ee. Updated CONTRIBUTING.md: added
mpremoteto requirements, clarified symlink behavior (local working directory, includes uncommitted changes), and documented all new targets (run,deploy-script,run-main).