Skip to content
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: rustup toolchain install nightly --profile minimal --component rustfmt,clippy
- run: cargo +nightly fmt --all -- --check
- run: cargo +nightly clippy -- -D warnings
- run: cargo +nightly clippy --all-targets -- -D warnings
- run: cargo +nightly build
- run: cargo +nightly test
- run: cargo +nightly build --release

ch32-v003:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ Releases up through `v0.4.0` were workspace-wide and tagged `vX.Y.Z`. From `0.4.

### Added

- `tinyboot discover` lists the addressable devices on a shared bus by unique id, with mode, versions and compatibility key, walking the id tree with `Select`.
- `--uid <hex>` on every device command picks one device by unique id (a unique prefix of whole bytes is enough). Without it the CLI selects the only device, refuses when several answer, and uses a device without addressing as it is.
- `tinyboot baud <rate>` stores the bootloader's baud and resets the device back into its current mode; in bootloader mode it reconnects at the new rate to check the bootloader answers. `tinyboot baud default` restores the build default.

### Changed

- Port auto-detection probes with an empty-prefix `Select` instead of Info, so it finds addressable devices too.
- `tinyboot reset` and `tinyboot flash --reset` wait for the bootloader's reply and report a refused reset to the app.
- `tinyboot flash` writes in chunks of the device's `max_payload` and, when the bootloader has a compatibility key, refuses an image with another key before erasing. `tinyboot info` prints the stored boot baud, the compatibility key and `max_payload`.

Expand Down
14 changes: 12 additions & 2 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,22 @@ cargo install --path cli

## Usage

Every command that talks to a device takes `--port`, `--baud` and `--uid`. `--uid` picks one device on a shared bus by its unique id, in hex as `tinyboot discover` prints it. A unique prefix of whole bytes is enough. Without `--uid` the CLI selects the only device on the bus, and stops with an error when more than one answers. A device without addressing is used as it is. See the [shared bus guide](https://openservocore.github.io/tinyboot/shared-bus.html).

### `tinyboot discover`

List the addressable devices on the bus by unique id, with mode, versions and compatibility key. With `--uid`, only the devices under that prefix.

```sh
tinyboot discover [--port /dev/ttyUSB0] [--baud 115200] [--uid 10]
```

### `tinyboot info`

Query device info (capacity, erase size, versions, mode).

```sh
tinyboot info [--port /dev/ttyUSB0] [--baud 115200]
tinyboot info [--port /dev/ttyUSB0] [--baud 115200] [--uid 1032]
```

### `tinyboot flash`
Expand Down Expand Up @@ -69,7 +79,7 @@ tinyboot bin firmware.elf -o firmware.bin

## Auto-detection

If `--port` is omitted, the CLI probes USB serial ports (usbmodem, ttyACM, ttyUSB) by sending an Info command with a 100ms timeout. Non-USB serial ports are skipped. Both the bootloader and apps running `poll()` respond to Info, so auto-detection works in either mode.
If `--port` is omitted, the CLI probes USB serial ports (usbmodem, ttyACM, ttyUSB) by sending a `Select` with an empty prefix and listening for any reply. Non-USB serial ports are skipped. Addressable devices answer with their id, others with `Unsupported`, in the bootloader and in apps running `poll()` alike, so auto-detection works in either mode.

## Single-wire bus echo

Expand Down
Loading
Loading