Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Only apply VID-only port property association to compatible dev tools#2517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@per1234
Copy link
Contributor

Summary

The Arduino boards platform framework allows properties of a port to beassociated 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 thevid port property value of0x30A4:

Blues.vid.0=0x30A4

Typically, in addition to thevid property, a companionpid property will also be associated so that the association is specific to devices with that VID/PID pair. However, this board definition only associates avid property. Although unusual, this is reasonable in this case where the board definition provides support for all models of theBlues 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 avid property without also associating apid 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 theTools > 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:

https://arduino.github.io/arduino-cli/latest/pluggable-discovery-specification/#board-identification

(while retaining support forthe 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.


This PR fixes/implements the followingbugs/features

Validation

  1. Install the version of the platform without this patch.
  2. Start Arduino IDE 1.8.19
  3. Connect any device to your computer that produces a serial port.
  4. Open theTools menu in Arduino IDE.
    🐛 ThePort menu item is grayed out, indicating no ports were discovered even though a port is present.
  5. SelectFile > Quit (orArduino > Quit Arduino for macOS users) from the Arduino IDE menus.
  6. Apply the patch proposed here.
  7. Start Arduino IDE 1.8.19
  8. SelectTools > Port from the Arduino IDE menus.
    🙂 All serial ports are listed in the menu.
  9. Start Arduino IDE 2.3.2
  10. Connect a device that produces a port with VID of0x30A4 to your computer.
  11. SelectTools > Port from the Arduino IDE menus.
    🙂 All serial ports are listed in the menu.
    🙂 The port of the device with VID of0x30A4 is labeled "(Blues boards)

Additional context

Even though, from a technical standpoint, this change restores the platform's support for Arduino IDE 1.x, my impression is that maintainability was also a factor in the decision to drop 1.x support (which is quite understandable). For this reason,the "only Arduino IDE 2 is supported" statement was not removed from the readme.

Closing issues

The Arduino boards platform framework allows properties of a port to beassociated with a board definition. The Arduino development softwarewill identify a port having the associated properties as that board.The "Blues boards" board definition contains an association for the vidport property value of 0x30A4. Typically, in addition to the vidproperty, a companion pid property will also be associated so that theassociation is specific to devices with that VID/PID pair. However, thisboard definition only associates a vid property. Although unusual, thisis reasonable in this case where the board definition provides supportfor all models of the Blues boards (rather than one specific model as istypically the case).Unfortunately it seems that the Arduino IDE 1.x codebase is written in away that assumes a PID association will always be provided along with aVID association. When a platform is installed that contains a boarddefinition that associates a vid property without also associating a pidproperty, it breaks port discovery entirely, causing no ports to bediscovered for any board.The port discovery and port properties association system has beencompletely reworked since the time of Arduino IDE 1.x. The modernsystem, which is used by Arduino IDE 2.x and Arduino CLI, doesn't haveany problem with this VID-only association. This means that it would bepossible to define this association without breaking Arduino IDE 1.x ifthe association could be applied exclusively for the modern Arduinodevelopment software versions. Arduino IDE 1.x only uses the portproperty association for the convenience feature of labeling the port inthe "Port" menu, so the lack of an association doesn't cause anymeaningful impact.At the time the port discovery and port properties association systemwas reworked, the port property association properties were renamed tosupport association with any arbitrary properties. (while retainingsupport for the old property names). The new property names are onlyrecognized by the modern Arduino development software and have no effecton Arduino IDE 1.x.The port association properties for the "Blues boards" board definitionare migrated from the old property names previously in use to the newnames. This causes the port property association to no longer berecognized by Arduino IDE 1.x, fixing the breakage of its port discoverysystem. The association will still be recognized by the modern versionsof Arduino development software just as before.
@fpistm
Copy link
Member

Hi@per1234
Thanks for the PR.
Anyway, I'm not a big fan of adding the "upload_port" as a fix.
I've tested my proposal here and it works:
#2511 (comment)
It is more homogeneous to fix like that.
Are you agreed?

@per1234
Copy link
ContributorAuthor

I've tested my proposal here and it works:
#2511 (comment)

The only relevant part of that diff is this:

--- a/boards.txt+++ b/boards.txt@@ -12463,7 +12463,7 @@ Blues.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSer Blues.build.flash_offset=0x0 Blues.upload.maximum_size=0 Blues.upload.maximum_data_size=0-Blues.vid.0=0x30A4  # Swan R5 board Blues.menu.pnum.SWAN_R5=Swan R5

The other changes might be worth making for other reasons, but they aren't relevant to#2469

That change will certainly fix#2469. However, assuming that providing identification for the ports of the Blues boards is considered desirable, it is clearly inferior to my proposal, which preserves the port identification for users of modern Arduino development software. You haven't provided any meaningful reason for rejecting my proposal.

@fpistm
Copy link
Member

In fact, no other boards have the "upload_port" property. That's why I told it is not homogeneous to use "upload_port".
If I had a chance I will develop a Discovery tool but no free time yet.

So to sum up, I used only this:
https://arduino.github.io/arduino-cli/1.0/platform-specification/#board-vidpid
Notupload_port.
Maybe it is a mistake I've made.
To be honest the description of the board vid/pid description and the upload_port is confusing and seems very closed.

fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this pull requestSep 24, 2024
Supersedestm32duino#2517Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this pull requestSep 24, 2024
Supersedestm32duino#2517Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistmfpistm mentioned this pull requestSep 24, 2024
@fpistmfpistm added the duplicateThis issue or pull request already exists labelSep 24, 2024
@fpistm
Copy link
Member

As no answer form OP, I've pushed a new PR (#2525) which supersede this one.
Discovery tools will be investigate later.

per1234 reacted with thumbs down emoji

@fpistmfpistm closed thisSep 24, 2024
fpistm added a commit that referenced this pull requestSep 24, 2024
Supersede#2517Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

duplicateThis issue or pull request already exists

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Blues: wrong pid definition for Cygnet COM port under the Tools menu no longer appeared on V2.8

2 participants

@per1234@fpistm

[8]ページ先頭

©2009-2025 Movatter.jp