Skip to content
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

Provide a way to identify board options via pluggable discovery #1660

Closed
cmaglie opened this issue Feb 14, 2022 · 6 comments · Fixed by #1674
Closed

Provide a way to identify board options via pluggable discovery #1660

cmaglie opened this issue Feb 14, 2022 · 6 comments · Fixed by #1674
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@cmaglie
Copy link
Member

cmaglie commented Feb 14, 2022

As per @PaulStoffregen comment:

How would you feel about extending Board Identification to allow JSON properties to match the menu options, so arduino-cli could know more of the FQBN?

VENDOR:ARCHITECTURE:BOARD_ID[:MENU_ID=OPTION_ID[,MENU2_ID=OPTION_ID ...]]

As I understand Board Identification, today arduino-cli can at best report the "VENDOR:ARCHITECTURE:BOARD_ID" portion of FQBN, because the spec only defines board.txt entries for matching the main part of FQBN.

If the Board Identification part of spec were extended slightly to specify boards.txt entries such as

{boardname}.menu.{menuname}.{menuoption}.upload_port.{identifier}=Value
{boardname}.menu.{menuname}.{menuoption}.upload_port.#.{identifier}=Value

then a discovery tools capable of detecting which menu options where used could report properties to match those lines. Future arduino-cli could use this property matching to give a more complete FQBN for the detected hardware. Then in an even farther future, the IDE could utilize the more specific FQBN to initialize those menu options when a user clicks the port+board from the toolbar's drop-down list.

I think it could be implemented exactly as described above.

@cmaglie cmaglie self-assigned this Feb 14, 2022
@cmaglie cmaglie added topic: CLI Related to the command line interface type: enhancement Proposed improvement labels Feb 14, 2022
@cmaglie cmaglie linked a pull request Feb 24, 2022 that will close this issue
5 tasks
@cmaglie cmaglie added this to the arduino-cli 0.22.0 milestone Feb 24, 2022
@PaulStoffregen
Copy link
Sponsor

@cmaglie - Now with IDE 2.0-rc7 supporting pluggable monitor, I'm revisiting my package for Teensy to better integrate with IDE 2.0. Any chance some of this can get put into the Pluggable Discovery Specification with notes about future implementation? My hope is to implement it soon in my discovery tool, and sometime in the future CLI & IDE 2.0 will make use of the extra info.

@cmaglie
Copy link
Member Author

cmaglie commented Jun 15, 2022

Hi @PaulStoffregen

I've actually implemented it here: #1674
It's rebased on the current master, so it's up-to-date, but I've just barely tested, so weird things may happen...
If you want to try it here are the test builds: https://github.com/arduino/arduino-cli/actions/runs/2501986948

There are still some task to be done:

  • add the documentation
  • add more tests
  • review the code

Considering my current priorities, this won't happen before July...

@PaulStoffregen
Copy link
Sponsor

Ran it here a few times and I'm happy to say Arduino CLI is picking it up the extra FQBN field nicely. So far my discovery tool is only detecting 1 of the FQBN menu parameters. Will try more soon...

In this run, IDE 1.8.19 programmed the hardware to be USB audio, and CLI board list is showing it properly with ":usb=audio" on the FQBN.

image

@ubidefeo
Copy link

ubidefeo commented Aug 5, 2022

@cmaglie @PaulStoffregen any updates on this one?

@per1234 per1234 added status: waiting for information More information must be provided before work can proceed topic: code Related to content of the project itself and removed topic: CLI Related to the command line interface labels Aug 5, 2022
@PaulStoffregen
Copy link
Sponsor

@ubidefeo - I implemented this for Teensy's "USB Type" menu in version 1.57.0 of teensy-discovery. This is the package index to install 1.57.0, if you want to give it a try.

https://www.pjrc.com/teensy/td_156/package_teensy_index.json

Sadly, I haven't had time to add USB descriptors and code in teensy-discovery for Teensy's other 3 menus. Been crazy busy here dealing with supply chain problems. But teensy-discovery 1.57.0 definitely does support a "usbtype" property and package 1.57.0 has corresponding lines in boards.txt needed to build the FQBN with that menu setting, as in the screenshot above.

@PaulStoffregen
Copy link
Sponsor

@per1234 - I see you tagged "status: waiting for information". I don't understand what more information could be needed? From @cmaglie's message on June 15, looks like we're waiting on 3 specific tasks before #1674 can be merged.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Aug 12, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants