Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ectf"
version = "2026.0.10"
version = "2026.0.11"
description = "Tools for eCTF competitors"
readme = "README.md"
authors = [
Expand Down
25 changes: 17 additions & 8 deletions src/ectf/hw/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def status_ti() -> None:
sys.exit(-1)

success("Successfully got bootloader status:")
success(f" - Version: {status.year}.{status.major_version}.{status.minor_version}")
success(
f" - Version: [cyan]{status.year}.{status.major_version}.{status.minor_version}"
)
success(f" - Secure bootloader: {bool(status.secure)}")
if status.installed is not None:
success(
Expand Down Expand Up @@ -86,15 +88,15 @@ def flash_ti(
] = None,
) -> None:
"""Flash a design onto the MSPM0L2228"""
if ".elf" in str(infile):
err_msg = (
with (infile / "hsm.bin" if infile.is_dir() else infile).open("rb") as f:
data = f.read()
if data.startswith(b"\x7fELF"):
error(
"Do not flash the .elf file. It's likely you are looking for the .bin file"
)
error(err_msg)
sys.exit(-1)

with infile.open("rb") as f:
image = Image.deserialize(f.read(), name)
image = Image.deserialize(data, name)

info(f"Flashing design {image.name}")
board = MSPM0L2228.from_port(CONFIG["PORT"], timeout=3)
Expand Down Expand Up @@ -146,8 +148,15 @@ def reflash_ti(
] = None,
) -> None:
"""Shortcut for erase, flash, then start"""
with (infile / "hsm.bin").open("rb") as f:
image = Image.deserialize(f.read(), name)
with (infile / "hsm.bin" if infile.is_dir() else infile).open("rb") as f:
data = f.read()
if data.startswith(b"\x7fELF"):
error(
"Do not flash the .elf file. It's likely you are looking for the .bin file"
)
sys.exit(-1)

image = Image.deserialize(data, name)

info("Reflashing design")
board = MSPM0L2228.from_port(CONFIG["PORT"], timeout=3)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.