Skip to content

Commit

Permalink
Renamed 'no-port' protocol to 'default'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed May 31, 2021
1 parent 2e078d4 commit 1885102
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions RFCs/0002-pluggable-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,17 +768,17 @@ tools.arduino_ota.upload.pattern="{runtime.tools.arduinoOTA.path}/bin/arduinoOTA
-sketch "{build.path}/{build.project_name}.bin"
```

#### Support for upload "without a port" (`no-port` dummy protocol)
#### Support for `default` fallback (allows upload "without a port")

Some upload tools already have the port detection builtin so there is no need to specify an upload port (for example the `openocd` tool is often able to autodetect the devices to upload by itself).

To support this particular use case a dummy `no-port` protocol has been reserved:
To support this particular use case a dummy `default` protocol has been reserved:

```
myboard.upload.tool.no-port=openocd_without_port
myboard.upload.tool.default=openocd_without_port
```

The `no-port` upload recipe will be selected when:
The `default` upload protocol is a kind of wildcard-protocol, it will be selected when:

- The upload port is not specified

Expand All @@ -789,21 +789,21 @@ or
Let's see some examples to clarify:

```
board1.upload.tool.no-port=openocd_without_port
board1.upload.tool.default=openocd_without_port
board2.upload.tool.serial=bossac
board2.upload.tool.no-port=openocd_without_port
board2.upload.tool.default=openocd_without_port
board3.upload.tool.serial=bossac
```

In the `board1` case: the `openocd_without_port` recipe will be always used, even if a port has been selected by the user.
In the `board1` case: the `openocd_without_port` recipe will be always used, whatever the user's port selection.

In the `board2` case: the `bossac` recipe will be used if the port selected is a `serial` port, otherwise the `openocd_without_port` will be used in all other cases (even if a port has been selected by the user).
In the `board2` case: the `bossac` recipe will be used if the port selected is a `serial` port, otherwise the `openocd_without_port` will be used in all other cases (whatever the user's port selection).

In the `board3` case: the `bossac` recipe will be used if the port selected is a `serial` port, otherwise the upload will fail.

A lot of existing platforms already have recipes without an explicit port address, in this case the upload tool specified in the old (non-pluggable) way will be considered as a `no-port` upload, for example let's consider the Arduino Zero board:
A lot of existing platforms already have recipes without an explicit port address, in this case the upload tool specified in the old (non-pluggable) way will be considered as a `default` protocol upload, for example let's consider the Arduino Zero board:

```
# Arduino Zero (Prorgamming Port)
Expand All @@ -812,7 +812,7 @@ arduino_zero_edbg.name=Arduino Zero (Programming Port)
arduino_zero_edbg.vid.0=0x03eb
arduino_zero_edbg.pid.0=0x2157
arduino_zero_edbg.upload.tool=openocd <--- CONSIDERED AS no-port PROT.
arduino_zero_edbg.upload.tool=openocd <--- CONSIDERED AS default PROTOCOL
arduino_zero_edbg.upload.protocol=sam-ba
arduino_zero_edbg.upload.maximum_size=262144
arduino_zero_edbg.upload.maximum_data_size=32768
Expand All @@ -821,10 +821,10 @@ arduino_zero_edbg.upload.wait_for_upload_port=false
arduino_zero_edbg.upload.native_usb=false
```

in this case the upload definition will be always considered as a `no-port` by default, in other words, it will be automatically converted into:
in this case the upload definition will be always considered as a `default` protocol, in other words, it will be automatically converted into:

```
arduino_zero_edbg.upload.no-port.tool=openocd
arduino_zero_edbg.upload.default.tool=openocd
```

## Open Questions
Expand Down

0 comments on commit 1885102

Please sign in to comment.