Skip to content

Commit 5bdfe30

Browse files
committed
Added no-port protocol support
1 parent c3242ad commit 5bdfe30

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

RFCs/0002-pluggable-discovery.md

+59
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,65 @@ tools.arduino_ota.upload.pattern="{runtime.tools.arduinoOTA.path}/bin/arduinoOTA
569569
-sketch "{build.path}/{build.project_name}.bin"
570570
```
571571

572+
#### Support for upload "without a port" (`no-port` dummy protocol)
573+
574+
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).
575+
576+
To support this particular use case a dummy `no-port` protocol has been reserved:
577+
578+
```
579+
myboard.upload.tool.no-port=openocd_without_port
580+
```
581+
582+
The `no-port` upload recipe will be selected when:
583+
584+
- The upload port is not specified
585+
586+
or
587+
588+
- The upload port is specified but the protocol of the selected port doesn't match any of the available upload protocols for a board
589+
590+
Let's see some examples to clarify:
591+
592+
```
593+
board1.upload.tool.no-port=openocd_without_port
594+
595+
board2.upload.tool.serial=bossac
596+
board2.upload.tool.no-port=openocd_without_port
597+
598+
board3.upload.tool.serial=bossac
599+
```
600+
601+
In the `board1` case: the `openocd_without_port` recipe will be always used, even if a port has been selected by the user.
602+
603+
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).
604+
605+
In the `board3` case: the `bossac` recipe will be used if the port selected is a `serial` port, otherwise the upload will fail.
606+
607+
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:
608+
609+
```
610+
# Arduino Zero (Prorgamming Port)
611+
# ---------------------------------------
612+
arduino_zero_edbg.name=Arduino Zero (Programming Port)
613+
arduino_zero_edbg.vid.0=0x03eb
614+
arduino_zero_edbg.pid.0=0x2157
615+
616+
arduino_zero_edbg.upload.tool=openocd <--- CONSIDERED AS no-port PROT.
617+
arduino_zero_edbg.upload.protocol=sam-ba
618+
arduino_zero_edbg.upload.maximum_size=262144
619+
arduino_zero_edbg.upload.maximum_data_size=32768
620+
arduino_zero_edbg.upload.use_1200bps_touch=false
621+
arduino_zero_edbg.upload.wait_for_upload_port=false
622+
arduino_zero_edbg.upload.native_usb=false
623+
```
624+
625+
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:
626+
627+
```
628+
arduino_zero_edbg.upload.no-port.tool=openocd
629+
```
630+
572631
## Open Questions
573632

574633
### CLI command line UX considerations

0 commit comments

Comments
 (0)