Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Oct 14, 2022
1 parent ccceb6c commit 1bcdd33
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions docs/pluggable-discovery-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,67 @@ myboard.upload_port.1.apples=40

will match on both `pears=20, apples=30` and `pears=30, apples=40` but not `pears=20, apples=40`, in that sense each
"set" of identification properties is independent from each other and cannot be mixed for port matching.

#### Identification of board options

The board identification can also identify [custom board options](platform-specification.md#custom-board-options) if the
corresponding `upload_port` properties are defined:

```
BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.IDENTIFIER=Value
BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.#.IDENTIFIER=Value
```

a discovery tools capable of detecting which menu options where used could report properties to match those lines. Let's
see an example to clarify it, in the following `boards.txt`:

```
myboard.upload_port.pid=0x0010
myboard.upload_port.vid=0x2341
myboard.menu.cpu.atmega1280=ATmega1280
myboard.menu.cpu.atmega1280.upload_port.c=atmega1280 <--- identification property for cpu=atmega1280
myboard.menu.cpu.atmega1280.build_cpu=atmega1280
myboard.menu.cpu.atmega2560=ATmega2560
myboard.menu.cpu.atmega2560.upload_port.c=atmega2560 <--- identification property for cpu=atmega2560
myboard.menu.cpu.atmega2560.build_cpu=atmega2560
myboard.menu.mem.1k=1KB
myboard.menu.mem.1k.upload_port.mem=1 <--- identification property for mem=1k
myboard.menu.mem.1k.build_mem=1024
myboard.menu.mem.2k=2KB
myboard.menu.mem.2k.upload_port.1.mem=2 <------ identification property for mem=2k (case 1)
myboard.menu.mem.2k.upload_port.2.ab=ef <---\
myboard.menu.mem.2k.upload_port.2.cd=gh <---+-- identification property for mem=2k (case 2)
myboard.menu.mem.2k.build_mem=2048
```

we have a board called `myboard` with two custom menu options `cpu` and `mem`. The discovery may provide extra
identification properties to determine the custom menu options of the connected board, for example the following
properties:

```
vid=0x0010
pid=0x2341
c=atmega2560
```

will match the FQBN `mypackage:avr:myboard:cpu=atmega2560` becuase of the property `c=atmega2560`. The identification
properties:

```
vid=0x0010
pid=0x2341
c=atmega2560
mem=2
```

will match the FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k`. The identification properties:

```
vid=0x0010
pid=0x2341
c=atmega2560
ab=ef
cd=gh
```

will match the FQBN `mypackage:avr:myboard:cpu=atmega2560,mem=2k` too (they will match the second set for `mem=2k`).

0 comments on commit 1bcdd33

Please sign in to comment.