Skip to content

Need assistance tracking down FQBNs for boards #138

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

Closed
scottchiefbaker opened this issue Jan 30, 2019 · 2 comments
Closed

Need assistance tracking down FQBNs for boards #138

scottchiefbaker opened this issue Jan 30, 2019 · 2 comments

Comments

@scottchiefbaker
Copy link

I came to Github to create an issue asking for the FQBN for an Arduino Nano with the "old" bootloader. Luckily I was able to find it in an old issue.

I'm working on a similar project which is a simple Makefile wrapper of the Arduino 1.5+ CLI commands. My question is, what is the proper way to track down the FQBN of a given board, and any potential CPU flags for variants?

I'm happy to come here and post an issue every time I run in to one, but that puts more work on you. Is there documentation somewhere that talks about FQBNs? Is there a way that I can read them from the IDE preferences?

@per1234
Copy link
Contributor

per1234 commented Jan 31, 2019

what is the proper way to track down the FQBN of a given board, and any potential CPU flags for variants?

For a board without custom menu options, you can get it from arduino-cli board listall, but this does not provide the complete FQBN in the case of boards like the Nano which have custom menus. When the menu option is not specified in the FQBN, arduino-cli should use the default value, but this is not always what you want.

You can determine the FQBN by looking at boards.txt. In the case of the Nano, you can see the option id cpu has three options:

  • atmega328
  • atmega328old
  • atmega168

https://github.com/arduino/ArduinoCore-avr/blob/1.6.21/boards.txt#L141-L184

## Arduino Nano w/ ATmega328P
## --------------------------
nano.menu.cpu.atmega328=ATmega328P

nano.menu.cpu.atmega328.upload.maximum_size=30720
nano.menu.cpu.atmega328.upload.maximum_data_size=2048
nano.menu.cpu.atmega328.upload.speed=115200

nano.menu.cpu.atmega328.bootloader.low_fuses=0xFF
nano.menu.cpu.atmega328.bootloader.high_fuses=0xDA
nano.menu.cpu.atmega328.bootloader.extended_fuses=0xFD
nano.menu.cpu.atmega328.bootloader.file=optiboot/optiboot_atmega328.hex

nano.menu.cpu.atmega328.build.mcu=atmega328p

## Arduino Nano w/ ATmega328P (old bootloader)
## --------------------------
nano.menu.cpu.atmega328old=ATmega328P (Old Bootloader)

nano.menu.cpu.atmega328old.upload.maximum_size=30720
nano.menu.cpu.atmega328old.upload.maximum_data_size=2048
nano.menu.cpu.atmega328old.upload.speed=57600

nano.menu.cpu.atmega328old.bootloader.low_fuses=0xFF
nano.menu.cpu.atmega328old.bootloader.high_fuses=0xDA
nano.menu.cpu.atmega328old.bootloader.extended_fuses=0xFD
nano.menu.cpu.atmega328old.bootloader.file=atmega/ATmegaBOOT_168_atmega328.hex

nano.menu.cpu.atmega328old.build.mcu=atmega328p

## Arduino Nano w/ ATmega168
## -------------------------
nano.menu.cpu.atmega168=ATmega168

nano.menu.cpu.atmega168.upload.maximum_size=14336
nano.menu.cpu.atmega168.upload.maximum_data_size=1024
nano.menu.cpu.atmega168.upload.speed=19200

nano.menu.cpu.atmega168.bootloader.low_fuses=0xff
nano.menu.cpu.atmega168.bootloader.high_fuses=0xdd
nano.menu.cpu.atmega168.bootloader.extended_fuses=0xF8
nano.menu.cpu.atmega168.bootloader.file=atmega/ATmegaBOOT_168_diecimila.hex

nano.menu.cpu.atmega168.build.mcu=atmega168

More information:
https://arduino.github.io/arduino-cli/latest/platform-specification/#custom-board-options

My current approach in the case of boards with custom Tools menus is to do a compilation in the Arduino IDE for the specific board configuration I want with File > Preferences > Show verbose output during: compilation enabled, and then copy the FQBN from the first line of the output in the black console window at the bottom of the Arduino IDE window. Quite crude, but it seems the fastest and least error-prone solution for me.

Is there a way that I can read them from the IDE preferences?

Not very easily, since the custom menu selections for every board you've ever used are all stored in preferences.txt. The only way you could practically do this is by clearing all the previous data out of preferences.txt before starting the IDE, selecting the desired board configuration, and then exiting the Arduino IDE to save the data to preferences.txt. I think my clumsy method is preferable to that.

There is a boards.txt parser Python script proposed for addition to the ESP8266 hardware package that extracts the FQBN components from boards.txt here: esp8266/Arduino#5657. That provides the option of human readable text output or machine readable JSON output.

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.

It might be nice for arduino-cli to provided something to show the available menu options for each board, in addition to the partial FQBNs provided by arduino-cli board listall.

@scottchiefbaker
Copy link
Author

This was extremely helpful, and exactly what I needed. Thank you.

facchinm added a commit to facchinm/arduino-cli that referenced this issue Feb 4, 2019
Should help discovering features "inline" (see arduino#138)
endorama added a commit that referenced this issue Jul 11, 2019
As reported in multiple issues (#138 #191 #271) finding the right FQBN for a board can be difficult.

Improving the documentation may help users to find the relevant information.

Specifically, this PR closes #271 and add little improvement as suggested in #191.
rsora pushed a commit that referenced this issue Jul 11, 2019
As reported in multiple issues (#138 #191 #271) finding the right FQBN for a board can be difficult.

Improving the documentation may help users to find the relevant information.

Specifically, this PR closes #271 and add little improvement as suggested in #191.
mastrolinux pushed a commit that referenced this issue Jul 16, 2019
As reported in multiple issues (#138 #191 #271) finding the right FQBN for a board can be difficult.

Improving the documentation may help users to find the relevant information.

Specifically, this PR closes #271 and add little improvement as suggested in #191.
per1234 pushed a commit that referenced this issue Nov 16, 2020
…download

Use temporary file for storing the downloaded OTA image.
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

No branches or pull requests

2 participants