Skip to content

Rework board attach command #1925

Closed
@umbynos

Description

@umbynos

The board attach command has a broken implementation:

Inconsistent port argument format

Currently, the command will only accept a port when passed in as a full path (e.g.: serial:///dev/cu.usbmodem14301). This is inconsistent with all the other commands that accept a port argument, which allow the more user friendly address (e.g.: /dev/cu.usbmodem14301) to be used.

The command must accept the same address format as the other commands.

In order to allow a protocol of the port to be specified in addition to the address in cases where this is necessary, the command should also support a --protocol flag just as in the other commands that accept a port argument. This information will be stored in the cpu.protocol field of sketch.json.

Support for the previous port format should be retained.

Outdated board identification feature

Currently, when a port is passed to the command, it attempts to automatically identify the board on that port and save its FQBN and name in the cpu.fqbn and cpu.name fields of sketch.json.

$ arduino-cli board attach serial:///dev/cu.usbmodem614601
Board found: Arduino MKR1000...
Selected fqbn: arduino:samd:mkr1000

$ cat sketch.json
{
  "cpu": {
  "fqbn": "arduino:samd:mkr1000",
  "name": "Arduino MKR1000",
  "port": "serial:///dev/cu.usbmodem614601"
  }
}

This feature uses the obsolete github.com/arduino/board-discovery module.

Although the feature could be modernized, its value is questionable. The available resources would be better allocated to more important work than to updating and maintaining the feature. For this reason, the auto-detection of board data from port feature should simply be removed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions