Skip to content

Commit 3688694

Browse files
committed
Document server, config
1 parent 756e0bf commit 3688694

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

src/content/docs/tools/probe-rs.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,62 @@ To use [RTT](https://docs.rs/rtt-target/latest/rtt_target/) or [defmt](https://d
3535
3636
This is great for inspecting a target - where you might not even have knowledge of the firmware - without altering its state.
3737
38+
## serve
39+
40+
> The probe-rs server and client support is gated behind the `remote` feature and are not available in the default distribution.
41+
42+
`probe-rs serve` starts a remote server on your machine. You can `run`, `attach` to a device, `read` and `write` memory, `list` probes and read device `info` from another machine.
43+
44+
The server communicates over websockets. It is recommended to add your own TLS layer on top of it. You can specify the bind address and port, as well as the list of user credentials in the `probe-rs` configuration file.
45+
46+
To connect to a server, use the `--host` and `--token` options: `probe-rs [command] --host ws[s]://<host> --token <token> [additional arguments]`.
47+
3848
## Additional commands
3949
4050
To learn more about additional commands, use the `probe-rs help` or `probe-rs <command> --help` commands.
4151
52+
## Configuration
53+
54+
`probe-rs` can be configured via a config file. Currently the following options are available:
55+
56+
- Server listening parameters
57+
- Server users
58+
- Command presets
59+
60+
The config file can be a `toml`, `json`, `yaml` or `yml` file located at the following paths:
61+
62+
- The current working folder
63+
- The folder of the `probe-rs` executable
64+
- The user's HOME directory
65+
66+
### Specifying server options
67+
68+
You can specify the port and bind address of the server, as well as a list of users. It is not possible to connect to a server that has no users. You can configure which probes a particular user may access. User tokens must be unique, and user names are only used to log access.
69+
70+
```toml
71+
[server]
72+
port = 3000 # default is 3000
73+
address = "127.0.0.1" # default is 0.0.0.0
74+
75+
[[server.users]]
76+
name = "user1"
77+
token = "foo"
78+
access = "all"
79+
# access = { allow = ["probe serial 1", "probe serial 2"] }
80+
# access = { deny = ["probe serial 1", "probe serial 2"] }
81+
```
82+
83+
### Specifying presets
84+
85+
Presets allow you to simplify the CLI arguments. You can define any number of presets, and then use the `--preset <name>` option to select one. The arguments in the preset will then be added to the command. You may create a `default` preset that will be selected when `--preset` is not specified.
86+
87+
For example, you may have the following presets:
88+
89+
```toml
90+
[presets]
91+
preset_name = { probe = "vid:pid:serial", host = "remote", token = "token" }
92+
```
93+
94+
Then, issuing the `probe-rs run <firmware> --preset preset_name` command will effectively run `probe-rs run <firmware> --probe vid:pid:serial --host remote --token token`.
95+
4296
</probe-rs-code>

0 commit comments

Comments
 (0)