diff --git a/firmware/README.md b/firmware/README.md index 1f0b81f..d99a0cf 100644 --- a/firmware/README.md +++ b/firmware/README.md @@ -20,6 +20,12 @@ Everything past that — EPD, SD, USB host, partial refresh, Wi-Fi/TLS, gitoxide push — is its own follow-up spike per [`docs/v0.1-mvp-technical.md`](../docs/v0.1-mvp-technical.md#hardware-bring-up-order). +## Quick commands + +A [`justfile`](https://github.com/casey/just) wraps the common commands and +sources the espup env itself — run `just` in this directory for the list +(`build`, `flash`, `monitor`, `info`, `ports`). + ## Build Once per shell session, source the espup env (sets `LIBCLANG_PATH` and adds diff --git a/firmware/justfile b/firmware/justfile new file mode 100644 index 0000000..b0c5816 --- /dev/null +++ b/firmware/justfile @@ -0,0 +1,30 @@ +# Typoena firmware — common commands. +# Recipes source ~/export-esp.sh themselves (LIBCLANG_PATH + Xtensa GCC), +# so no per-shell setup is needed before calling just. + +esp_env := ". ~/export-esp.sh &&" +elf := "target/xtensa-esp32s3-espidf/release/firmware" + +# list recipes +default: + @just --list + +# compile (release) +build: + {{esp_env}} cargo build --release + +# build + flash + open serial monitor +flash: + {{esp_env}} cargo run --release + +# serial monitor only, with decoded backtraces +monitor: + espflash monitor --elf {{elf}} + +# detect board, print chip/MAC/flash size +info: + espflash board-info + +# list USB serial devices +ports: + @ls /dev/cu.usb* 2>/dev/null || echo "no USB serial device found"