Building and testing MCU firmware¶
Start with MCU development for the board names, source paths and Kconfig selections. All commands below run in the Kalico checkout.
Building¶
scripts/build_c5_update.py does one stage per command:
| Command | What it does |
|---|---|
build --board <board> --output-dir <dir> |
Builds one board (eBoard, heaterBoard, levelBoard or mainBoardGD) |
validate |
Checks a build (--firmware, --elf, --dictionary) |
package |
Makes stock-style update packages from existing builds |
inspect --input <package> |
Looks inside a package; --decrypt shows its contents |
all |
Builds, checks and packages every --board given, in one run |
The check compares each board's command dictionary with the commands it must
and mustn't have. For the mainboard that means the config_mclib family and
none of the stock library's commands, so a half-updated board fails the build
instead of the printer.
A release comes from one all run on a clean, committed checkout. It needs
FlashForge's update passphrase and one stock update per printer model as a
template; --template and --output pair up in order, one per model, and
--output-dir must be empty. The run writes the stock-style packages (for the
installer and for tunneled printers) and a live/ folder with the four .hex
files, SHA256SUMS and VERSION. The full command is in
docs/Creator5_Updates.md in Kalico.
The boards report the build's commit hash as their version. The installer and
updater treat a board as current when the first 8 characters of that hash
match, so build from a checkout without release tags: a tagged checkout
reports v2026...-g<hash>. docs/Creator5_Updates.md suggests cloning
without tags and setting git config core.abbrev 9.
Testing¶
The Creator 5 code has host-side tests in Kalico's test/ folder:
| Test | Covers |
|---|---|
test_c5_mclib.py (with c5_mclib.c) |
The motor control core |
test_c5_eboard_pa.py, test_c5_eboard_fast_step.py |
eBoard pressure-advance sensing and stepping |
test_c5_levelboard.py |
Levelboard logic |
test_c5_tmc_uart.py |
The eBoard TMC2209 UART transport |
test_c5_motion_guard.py |
The motion guard |
test_c5_update.py |
The update maker: hex parsing, checksums, packaging |
The C cores (src/c5_mclib.c and the others) have no hardware registers, so
the tests compile them with the host's gcc (-Wall -Wextra -Werror) against
the C files of the same name in test/ and run them there. Run them with
pytest from the Kalico checkout, for example
python -m pytest test/test_c5_mclib.py.
On the printer, check what each board runs from the Klipper log or the
mcu_version it reports, and compare it with VERSION in opencreator-fs
mcu-firmware/.
After a successful build, choose a release, live test or stock-package path in Flashing.