summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/README.md b/README.md
index abb94d7..7ccc7b9 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ zig build # compile, link, and emit a flashable image
zig build flash # ...then write it to the chip and run it
zig build run # flash, then print the console (ordered; `flash monitor` is not)
zig build monitor # reset the board and print its console
-zig build console # attach an interactive terminal: keystrokes in, screen out (Ctrl-] detaches)
+zig build console # attach a terminal to whatever is already on the board (Ctrl-] detaches)
zig build interact # flash, then attach that terminal (ordered, like `run`)
zig build reset # just pulse the reset line
zig build size # where every byte of the image went
@@ -19,6 +19,20 @@ against a linker script this `build.zig` generates; the image builder and the se
ordinary Zig code in `tools/`, imported straight into `build.zig`, so they leave no artefacts of
their own. What lands in `zig-out` is one file: the image.
+One exception, and it earns it: `zig build console` also installs `zig-out/bin/p4-console`, a host
+binary that opens the port and nothing else. Run it directly and there is no build runner in the
+picture — which matters, because an interactive step lives for as long as the human does, and
+`std.Progress` would otherwise redraw the build tree over the screen every 80 ms. std solves that
+for child processes by holding `io.lockStderr()` for the child's whole lifetime
+(`std/Build/Step/Run.zig:1588-1592`), which is the same lock `Progress` needs to draw, so both
+spellings are clean; the binary is simply the one that assumes the board is already flashed.
+
+```
+zig-out/bin/p4-console # the board is already programmed; just connect
+zig-out/bin/p4-console --no-reset # ...and do not pulse reset, so a live session survives
+zig-out/bin/p4-console --port /dev/ttyUSB1 --baud 115200
+```
+
## Why it exists
| | ESP-IDF blink | earlier Zig proof-of-concept | this |