Skip to content

Commit 71b5037

Browse files
committed
Move information re: allowed characters for FQBN component to specifications
Arduino CLI restricts which characters can be used by platform developers in their vendor, architecture, board, custom board menu, and custom board option identifiers. Previously, the information was only documented(?) in the "FAQ". This type of requirement must be present in the formal specifications. A platform developer is unlikely to ever think to look for such information in the FAQ. In addition, the inclusion of such information in the FAQ is not appropriate as this is intended for end users of the Arduino CLI application and end users have no control over which characters were used by the platform developers in their identifiers. So the presence of the information in the FAQ only harms readability by introducing unnecessary complexity into a subject that users often struggle to understand.
1 parent faf79a7 commit 71b5037

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

docs/FAQ.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ When you run [`arduino-cli board list`][arduino cli board list], your board does
1111

1212
FQBN stands for Fully Qualified Board Name. It has the following format:
1313
`VENDOR:ARCHITECTURE:BOARD_ID[:MENU_ID=OPTION_ID[,MENU2_ID=OPTION_ID ...]]`, with each `MENU_ID=OPTION_ID` being an
14-
optional key-value pair configuration. Each field accepts letters (`A-Z` or `a-z`), numbers (`0-9`), underscores (`_`),
15-
dashes(`-`) and dots(`.`). The special character `=` is accepted in the configuration value. The `VENDOR` and
16-
`ARCHITECTURE` parts can be empty. For a deeper understanding of how FQBN works, you should understand the [Arduino
17-
platform specification][0].
14+
optional key-value pair configuration. The `VENDOR` and `ARCHITECTURE` parts can be empty. For a deeper understanding of
15+
how FQBN works, you should understand the [Arduino platform specification][0].
1816

1917
## How to set multiple board options?
2018

docs/package_index_json-specification.md

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ The metadata fields are:
6464
- `name`: the folder used for the installed cores. The
6565
[vendor folder](platform-specification.md#hardware-folders-structure) name of the installed package is determined by
6666
this field
67+
- The value must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers (`0`-`9`), underscores
68+
(`_`), dashes (`-`), and dots (`.`).
6769
- `maintainer`: the extended name of the vendor that is displayed on the Arduino IDE Boards Manager GUI
6870
- `websiteURL`: the URL to the vendor's website, appears on the Arduino IDE Boards Manager as a "More info" link
6971
- `email`: the email of the vendor/maintainer
@@ -260,6 +262,8 @@ Each PLATFORM describes a core for a specific architecture. The fields needed ar
260262
- `name`: the extended name of the platform that is displayed on the Boards Manager GUI
261263
- `architecture`: is the architecture of the platform (avr, sam, etc...). It must match the architecture of the core as
262264
explained in the [Arduino platform specification](platform-specification.md#hardware-folders-structure)
265+
- The value must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers (`0`-`9`), underscores
266+
(`_`), dashes (`-`), and dots (`.`).
263267
- `version`: the version of the platform.
264268
- `deprecated`: (optional) setting to `true` causes the platform to be moved to the bottom of all Boards Manager and
265269
[`arduino-cli core`](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_core/) listings and marked

docs/platform-specification.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ Alternatively, a platform may be manually installed by the user inside the Sketc
2424
- `{directories.user}` is the user directory as specified in the
2525
[configuration file](configuration.md#default-directories).
2626
- `{VENDOR_NAME}` is the identifier of the vendor/maintainer of the platform.
27+
- The name of the vendor directory must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers
28+
(`0`-`9`), underscores (`_`), dashes (`-`), and dots (`.`).
2729
- `{ARCHITECTURE}` is the architecture of the CPU used in the platform.
30+
- The name of the architecture directory must not contain any characters other than the letters `A`-`Z` and `a`-`z`,
31+
numbers (`0`-`9`), underscores (`_`), dashes (`-`), and dots (`.`).
2832

2933
A vendor/maintainer may have multiple supported architectures.
3034

@@ -534,6 +538,9 @@ This file contains definitions and metadata for the boards supported by the plat
534538
short name, the board ID. The settings for a board are defined through a set of properties with keys having the board ID
535539
as prefix.
536540

541+
The board ID must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers (`0`-`9`), underscores
542+
(`_`), and dashes (`-`).
543+
537544
For example, the board ID chosen for the Arduino Uno board is "uno". An extract of the Uno board configuration in
538545
boards.txt looks like:
539546

@@ -1591,8 +1598,13 @@ This board was produced in two models, one with an ATmega168 microcontroller and
15911598
going then to define a custom option, using the "cpu" MENU_ID, that allows the user to choose between the two different
15921599
microcontrollers.
15931600

1594-
We must first define a set of **menu.MENU_ID=Text** properties. **Text** is what is displayed on the GUI for every
1595-
custom menu we are going to create and must be declared at the beginning of the boards.txt file:
1601+
We must first define a set of **menu.MENU_ID=Text** properties.
1602+
1603+
The menu ID must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers (`0`-`9`), underscores
1604+
(`_`), and dashes (`-`).
1605+
1606+
**Text** is what is displayed on the GUI for every custom menu we are going to create and must be declared at the
1607+
beginning of the boards.txt file:
15961608

15971609
```
15981610
menu.cpu=Processor
@@ -1627,7 +1639,12 @@ duemilanove.menu.cpu.atmega168=ATmega168
16271639

16281640
We have defined two values: "atmega328" and "atmega168".<br> Note that the property keys must follow the format
16291641
**BOARD_ID.menu.MENU_ID.OPTION_ID=Text**, where **Text** is what is displayed under the "Processor" menu in the IDE's
1630-
GUI.<br> Finally, the specific configuration for each option value:
1642+
GUI.
1643+
1644+
The option ID must not contain any characters other than the letters `A`-`Z` and `a`-`z`, numbers (`0`-`9`), underscores
1645+
(`_`), dashes (`-`), and equal signs (`=`).
1646+
1647+
Finally, the specific configuration for each option value:
16311648

16321649
```
16331650
[.....]

0 commit comments

Comments
 (0)