Skip to content

Commit 0271d36

Browse files
committed
Added docs
1 parent 59af89d commit 0271d36

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

docs/sketch-project-file.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Each profile will define:
1515
- A possible core platform name and version, that is a dependency of the target core platform (with the 3rd party
1616
platform index URL if needed)
1717
- The libraries used in the sketch (including their version)
18+
- The port and protocol to upload the sketch and monitor the board
1819

1920
The format of the file is the following:
2021

@@ -33,7 +34,11 @@ profiles:
3334
- <LIB_NAME> (<LIB_VERSION>)
3435
- <LIB_NAME> (<LIB_VERSION>)
3536
- <LIB_NAME> (<LIB_VERSION>)
36-
37+
port: <PORT_NAME>
38+
port_config:
39+
<PORT_SETTING_NAME>: <PORT_SETTING_VALUE>
40+
...
41+
protocol: <PORT_PROTOCOL>
3742
...more profiles here...
3843
```
3944

@@ -54,6 +59,15 @@ otherwise below). The available fields are:
5459
- `<USER_NOTES>` is a free text string available to the developer to add comments. This field is optional.
5560
- `<PROGRAMMER>` is the programmer that will be used. This field is optional.
5661

62+
The following fields are available since Arduino CLI 1.1.0:
63+
64+
- `<PORT_NAME>` is the port that will be used to upload and monitor the board (unless explicitly set otherwise). This
65+
field is optional.
66+
- `port_config` section with `<PORT_SETTING_NAME>` and `<PORT_SETTING_VALUE>` defines the port settings that will be
67+
used in the `monitor` command. Typically is used to set the baudrate for the serial port (for example
68+
`baudrate: 115200`) but any setting/value can be specified. Multiple settings can be set. These fields are optional.
69+
- `<PORT_PROTOCOL>` is the protocol for the port used to upload and monitor the board. This field is optional.
70+
5771
A complete example of a sketch project file may be the following:
5872

5973
```
@@ -76,6 +90,9 @@ profiles:
7690
- VitconMQTT (1.0.1)
7791
- Arduino_ConnectionHandler (0.6.4)
7892
- TinyDHT sensor library (1.1.0)
93+
port: /dev/ttyACM0
94+
port_config:
95+
baudrate: 115200
7996
8097
tiny:
8198
notes: testing the very limit of the AVR platform, it will be very unstable
@@ -139,6 +156,8 @@ particular:
139156
- The `default_fqbn` key sets the default value for the `--fqbn` flag
140157
- The `default_programmer` key sets the default value for the `--programmer` flag
141158
- The `default_port` key sets the default value for the `--port` flag
159+
- The `default_port_config` key sets the default values for the `--config` flag in the `monitor` command (available
160+
since Arduino CLI 1.1.0)
142161
- The `default_protocol` key sets the default value for the `--protocol` flag
143162
- The `default_profile` key sets the default value for the `--profile` flag
144163

@@ -148,11 +167,14 @@ For example:
148167
default_fqbn: arduino:samd:mkr1000
149168
default_programmer: atmel_ice
150169
default_port: /dev/ttyACM0
170+
default_port_config:
171+
baudrate: 115200
151172
default_protocol: serial
152173
default_profile: myprofile
153174
```
154175

155176
With this configuration set, it is not necessary to specify the `--fqbn`, `--programmer`, `--port`, `--protocol` or
156177
`--profile` flags to the [`arduino-cli compile`](commands/arduino-cli_compile.md),
157178
[`arduino-cli upload`](commands/arduino-cli_upload.md) or [`arduino-cli debug`](commands/arduino-cli_debug.md) commands
158-
when compiling, uploading or debugging the sketch.
179+
when compiling, uploading or debugging the sketch. Moreover in the `monitor` command it is not necessary to specify the
180+
`--config baudrate=115200` to communicate with the monitor port of the board.

0 commit comments

Comments
 (0)