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

json boards.txt parser to help building FQBN #5657

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Jan 23, 2019

Output looks like:

#
# -- Arduino boards.txt parser for FQBN details --
#
# random example:
#     esp8266com:esp8266:d1:xtal=80,vt=flash,exception=disabled,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=460800
#
# description of possible values in configurable menu entries:
# (run with '--machine' for machine version)
#
#
{
  "boards": {
    "generic": "ESP8266_GENERIC", 
    "esp8285": "ESP8266_ESP01", 
...
  }, 
  "options": {
    "UploadTool": "Upload Tool", 
    "BoardModel": "Model", 
    "baud": "Upload Speed", 
    "xtal": "CPU Frequency", 
    "CrystalFreq": "Crystal Frequency", 
    "eesz": "Flash Size", 
...
  }, 
  "values": {
    "xtal": {
      "80": "CPU Frequency: 80 MHz", 
      "160": "CPU Frequency: 160 MHz"
    }, 
    "vt": {
      "flash": "VTables: Flash", 
      "heap": "VTables: Heap", 
      "iram": "VTables: IRAM"
    }, 
    "exception": {
      "disabled": "Exceptions: Disabled", 
      "enabled": "Exceptions: Enabled"
    }, 
    "ResetMethod": {
      "ck": "Reset Method: ck", 
      "nodemcu": "Reset Method: nodemcu", 
      "none": "Reset Method: none", 
      "dtrset": "Reset Method: dtrset", 
      "v2": "Reset Method: ESPduino-V2", 
      "v1": "Reset Method: ESPduino-V1"
    }, 
    "CrystalFreq": {
      "26": "Crystal Frequency: 26 MHz", 
      "40": "Crystal Frequency: 40 MHz"
    }, 
...
  }
}

With --machine option:

{"boards": {"generic": "ESP8266_GENERIC", "esp8285": "ESP8266_ESP01", "espduino": "ESP8266_ESP13", "huzzah": "ESP8266_ESP12", "inventone": "ESP8266_GENERIC", "cw01": "ESP8266_GENERIC", "espresso_lite_v1": "ESP8266_ESPRESSO_LITE_V1", "espresso_lite_v2": "ESP8266_ESPRESSO_LITE_V2", "phoenix_v1": "ESP8266_PHOENIX_V1", "phoenix_v2": "ESP8266_PHOENIX_V2", "nodemcu": "ESP8266_NODEMCU", "nodemcuv2": "ESP8266_...

@per1234 #5572

@d-a-v
Copy link
Collaborator Author

d-a-v commented Jan 24, 2019

@per1234 please check this update per your suggestion
https://gist.github.com/d-a-v/c3cceb80d61d509908d1061f6f85b9df

@d-a-v
Copy link
Collaborator Author

d-a-v commented Jan 28, 2019

human output from boards.txt parsing, showing fqbn meanings
https://gist.github.com/d-a-v/481ac17ea9becf99bdcf239fe2415837

@d-a-v
Copy link
Collaborator Author

d-a-v commented May 25, 2019

@per1234 per your comment

Now that I reconsider that Python script, I think it's a bit flawed for universal usage because it will only truly be useful for packages like ESP8266 that use the same options for all boards. Other packages like Arduino AVR Boards only provide certain options for certain boards. I'll provide some feedback to the author about this.

Should I pursue with this script ?
Wouldn't it better be stored in a more general location like in Arduino itself (with your proposal integrated) ?

@per1234
Copy link
Contributor

per1234 commented May 25, 2019

@d-a-v Hi! Sorry this got lost in my "to-do" list. The issue of people not understanding how to determine the FQBN for a board for use in arduino-cli or the Arduino IDE CLI commands has come up repeatedly. My usual advice of running a compilation in the IDE with verbose output on and then digging the FQBN out of the output is certainly not ideal. Learning to determine an FQBN just from looking at a hardware package is not simple for someone without a prior understanding of how Arduino's hardware package system works. I do think that a dedicated tool that made this easy could be very useful to that type of user.

That is in addition to potential for the script to be very useful for automated processes, as we discussed previously.

I do think that, if the script was made applicable to all hardware packages, it would make sense to publish it outside the esp8266/Arduino repository to make it easier for people to find and use. This repository could always add it as a subtree or submodule if it were wanted. I can't speak for the Arduino developers on whether they would be interested in adding your script to one of their repositories. Given unlimited resources, I think it would be better to implement something similar in the arduino-cli code, rather than having a separate tool. I see your script as being a 3rd party solution to a need Arduino has not provided for. For that reason, I would just publish it in a dedicated repository were it my project. There's certainly no harm in submitting a PR to Arduino though if you think it makes sense in one of their repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants