-
-
Notifications
You must be signed in to change notification settings - Fork 398
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance board config auto-selection with hardwareId #1913
Enhance board config auto-selection with hardwareId #1913
Conversation
arduino-ide-extension/src/browser/boards/boards-service-provider.ts
Outdated
Show resolved
Hide resolved
If anybody is wondering what's the effective code change: include-hardwareId-in-auto-selection...enhance-auto-selection-with-hardwareId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one remark regarding the name
fallback. The rest look OK to me. Thanks
arduino-ide-extension/src/browser/boards/boards-service-provider.ts
Outdated
Show resolved
Hide resolved
0cee491
to
2fb1757
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is working perfectly for me. Thanks Dave!
To anyone interested in testing this: I'll share the procedure I found:
Required Equipment
- A board with the following characteristics:
- Persistent bootloader mode activated by a double reset
- Both the application port and the bootloader port have the same hardware ID (usually a serial number)
- A Windows or macOS PC
- Linux is not suitable because it doesn't assign different addresses to the application and bootloader ports.
I found that the Portenta H7 was the only board I had on hand with the required characteristics.
Steps
- Connect the board to your computer.
- Select the board's port in Arduino IDE.
- Press and release the reset button on the board twice quickly to put it in bootloader mode.
Before the change made by this PR, no port would be selected after the board's port address changed when it went into bootloader mode.
After the change made by this PR, the port selection automatically follows the board to the address of the bootloader port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also done manual tests of this PR, involving some testing some hard-coded changes to simulate everything "working as it should" in the process chain.
From my tests, the board selector correctly auto-selects the correct port with hardwareId, when a board exposing a hardwareId disappears from a port and reappears on a different port in a different app state.
This PR has been created to support the "auto-reconnecting" to a board in DFU mode, which the R4 Minima goes into during upload and reset. The primary motivation was to make IDE2 compatible with the Uno R4 board. |
Note
This PR builds on 1885, but its considered fundamentally different as it changes the UX for many other boards.
Motivation
It may be convenient for users if the IDE2 were to "auto-select" a "new" port on their behalf in the following scenario: when they select a board and port, unplug that board from its port, and plug it into a "new" port.
Now that we receive
hardwareId
s from the CLI for boards that expose them, we can reliably "auto-select" a board/port in the above scenario, as we can distinguish between two boards with the samefqbn
.At present in the unplug/replug scenario we only auto-select a board-port combo when it's unplugged/plugged from/into the same port, or if a port change occur during upload.
Change description
If a specific board's port changes to a "new" port, and that board exposes a
hardwareId
, its "new" port should always be selected automatically.These changes are expected to enhance the UX for boards that expose a
hardwareId
, the UX will not change for boards that do not, for example in my (@davegarthsimpson) testing the Arduino Leonardo does not expose one.Acceptance Criteria
Boards with hardwareId
-Their port should be automatically re-selected when it changes (while the board remains selected),
Board without hardwareId
-Their port will only be re-selected when it changes (while the board remains selected),
Example boards with hardwareId (to the authors knowledge): Arduino Zero, Arduino Uno
Example boards without hardwareId (to the authors knowledge): Arduino Leonardo, Arduino Due (Native USB Port)
Reviewer checklist