@@ -377,3 +377,67 @@ myboard.upload_port.1.apples=40
377
377
378
378
will match on both ` pears=20, apples=30 ` and ` pears=30, apples=40 ` but not ` pears=20, apples=40 ` , in that sense each
379
379
"set" of identification properties is independent from each other and cannot be mixed for port matching.
380
+
381
+ #### Identification of board options
382
+
383
+ The board identification can also identify [ custom board options] ( platform-specification.md#custom-board-options ) if the
384
+ corresponding ` upload_port ` properties are defined:
385
+
386
+ ```
387
+ BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.IDENTIFIER=Value
388
+ BOARDNAME.menu.MENUNAME.MENUOPTION.upload_port.#.IDENTIFIER=Value
389
+ ```
390
+
391
+ a discovery tools capable of detecting which menu options where used could report properties to match those lines. Let's
392
+ see an example to clarify it, in the following ` boards.txt ` :
393
+
394
+ ```
395
+ myboard.upload_port.pid=0x0010
396
+ myboard.upload_port.vid=0x2341
397
+ myboard.menu.cpu.atmega1280=ATmega1280
398
+ myboard.menu.cpu.atmega1280.upload_port.c=atmega1280 <--- identification property for cpu=atmega1280
399
+ myboard.menu.cpu.atmega1280.build_cpu=atmega1280
400
+ myboard.menu.cpu.atmega2560=ATmega2560
401
+ myboard.menu.cpu.atmega2560.upload_port.c=atmega2560 <--- identification property for cpu=atmega2560
402
+ myboard.menu.cpu.atmega2560.build_cpu=atmega2560
403
+ myboard.menu.mem.1k=1KB
404
+ myboard.menu.mem.1k.upload_port.mem=1 <--- identification property for mem=1k
405
+ myboard.menu.mem.1k.build_mem=1024
406
+ myboard.menu.mem.2k=2KB
407
+ myboard.menu.mem.2k.upload_port.1.mem=2 <------ identification property for mem=2k (case 1)
408
+ myboard.menu.mem.2k.upload_port.2.ab=ef <---\
409
+ myboard.menu.mem.2k.upload_port.2.cd=gh <---+-- identification property for mem=2k (case 2)
410
+ myboard.menu.mem.2k.build_mem=2048
411
+ ```
412
+
413
+ we have a board called ` myboard ` with two custom menu options ` cpu ` and ` mem ` . The discovery may provide extra
414
+ identification properties to determine the custom menu options of the connected board, for example the following
415
+ properties:
416
+
417
+ ```
418
+ vid=0x0010
419
+ pid=0x2341
420
+ c=atmega2560
421
+ ```
422
+
423
+ will match the FQBN ` mypackage:avr:myboard:cpu=atmega2560 ` becuase of the property ` c=atmega2560 ` . The identification
424
+ properties:
425
+
426
+ ```
427
+ vid=0x0010
428
+ pid=0x2341
429
+ c=atmega2560
430
+ mem=2
431
+ ```
432
+
433
+ will match the FQBN ` mypackage:avr:myboard:cpu=atmega2560,mem=2k ` . The identification properties:
434
+
435
+ ```
436
+ vid=0x0010
437
+ pid=0x2341
438
+ c=atmega2560
439
+ ab=ef
440
+ cd=gh
441
+ ```
442
+
443
+ will match the FQBN ` mypackage:avr:myboard:cpu=atmega2560,mem=2k ` too (they will match the second set for ` mem=2k ` ).
0 commit comments