Skip to content

Commit a8bb741

Browse files
committed
Only apply VID-only port property association to compatible dev tools
The Arduino boards platform framework allows properties of a port to be associated with a board definition. The Arduino development software will identify a port having the associated properties as that board. The "Blues boards" board definition contains an association for the vid port property value of 0x30A4. Typically, in addition to the vid property, a companion pid property will also be associated so that the association is specific to devices with that VID/PID pair. However, this board definition only associates a vid property. Although unusual, this is reasonable in this case where the board definition provides support for all models of the Blues boards (rather than one specific model as is typically the case). Unfortunately it seems that the Arduino IDE 1.x codebase is written in a way that assumes a PID association will always be provided along with a VID association. When a platform is installed that contains a board definition that associates a vid property without also associating a pid property, it breaks port discovery entirely, causing no ports to be discovered for any board. The port discovery and port properties association system has been completely reworked since the time of Arduino IDE 1.x. The modern system, which is used by Arduino IDE 2.x and Arduino CLI, doesn't have any problem with this VID-only association. This means that it would be possible to define this association without breaking Arduino IDE 1.x if the association could be applied exclusively for the modern Arduino development software versions. Arduino IDE 1.x only uses the port property association for the convenience feature of labeling the port in the "Port" menu, so the lack of an association doesn't cause any meaningful impact. At the time the port discovery and port properties association system was reworked, the port property association properties were renamed to support association with any arbitrary properties. (while retaining support for the old property names). The new property names are only recognized by the modern Arduino development software and have no effect on Arduino IDE 1.x. The port association properties for the "Blues boards" board definition are migrated from the old property names previously in use to the new names. This causes the port property association to no longer be recognized by Arduino IDE 1.x, fixing the breakage of its port discovery system. The association will still be recognized by the modern versions of Arduino development software just as before.
1 parent 89a2951 commit a8bb741

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12463,7 +12463,7 @@ Blues.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer
1246312463
Blues.build.flash_offset=0x0
1246412464
Blues.upload.maximum_size=0
1246512465
Blues.upload.maximum_data_size=0
12466-
Blues.vid.0=0x30A4
12466+
Blues.upload_port.0.vid=0x30A4
1246712467

1246812468
# Swan R5 board
1246912469
Blues.menu.pnum.SWAN_R5=Swan R5

0 commit comments

Comments
 (0)