@@ -15,6 +15,7 @@ Each profile will define:
15
15
- A possible core platform name and version, that is a dependency of the target core platform (with the 3rd party
16
16
platform index URL if needed)
17
17
- The libraries used in the sketch (including their version)
18
+ - The port and protocol to upload the sketch and monitor the board
18
19
19
20
The format of the file is the following:
20
21
@@ -33,7 +34,11 @@ profiles:
33
34
- <LIB_NAME> (<LIB_VERSION>)
34
35
- <LIB_NAME> (<LIB_VERSION>)
35
36
- <LIB_NAME> (<LIB_VERSION>)
36
-
37
+ port: <PORT_NAME>
38
+ port_config:
39
+ <PORT_SETTING_NAME>: <PORT_SETTING_VALUE>
40
+ ...
41
+ protocol: <PORT_PROTOCOL>
37
42
...more profiles here...
38
43
```
39
44
@@ -54,6 +59,15 @@ otherwise below). The available fields are:
54
59
- ` <USER_NOTES> ` is a free text string available to the developer to add comments. This field is optional.
55
60
- ` <PROGRAMMER> ` is the programmer that will be used. This field is optional.
56
61
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
+
57
71
A complete example of a sketch project file may be the following:
58
72
59
73
```
@@ -76,6 +90,9 @@ profiles:
76
90
- VitconMQTT (1.0.1)
77
91
- Arduino_ConnectionHandler (0.6.4)
78
92
- TinyDHT sensor library (1.1.0)
93
+ port: /dev/ttyACM0
94
+ port_config:
95
+ baudrate: 115200
79
96
80
97
tiny:
81
98
notes: testing the very limit of the AVR platform, it will be very unstable
@@ -139,6 +156,8 @@ particular:
139
156
- The ` default_fqbn ` key sets the default value for the ` --fqbn ` flag
140
157
- The ` default_programmer ` key sets the default value for the ` --programmer ` flag
141
158
- 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)
142
161
- The ` default_protocol ` key sets the default value for the ` --protocol ` flag
143
162
- The ` default_profile ` key sets the default value for the ` --profile ` flag
144
163
@@ -148,11 +167,14 @@ For example:
148
167
default_fqbn: arduino:samd:mkr1000
149
168
default_programmer: atmel_ice
150
169
default_port: /dev/ttyACM0
170
+ default_port_config:
171
+ baudrate: 115200
151
172
default_protocol: serial
152
173
default_profile: myprofile
153
174
```
154
175
155
176
With this configuration set, it is not necessary to specify the ` --fqbn ` , ` --programmer ` , ` --port ` , ` --protocol ` or
156
177
` --profile ` flags to the [ ` arduino-cli compile ` ] ( commands/arduino-cli_compile.md ) ,
157
178
[ ` 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