-
-
Notifications
You must be signed in to change notification settings - Fork 482
Description
Describe the problem
Arduino boards platform authors can define arbitrary custom board options to provide additional configurability for a given board selection. These options are presented to the Arduino IDE user as arbitrary submenus under the IDE's Tools menu.
At the machine level, custom board options are specified as part of the FQBN, following this format:
<vendor ID>:<architecture>:<board ID>[:<menu ID>=<option ID>[,<menu ID>=<option ID>]...]
Arduino IDE stores the FQBN data for a couple of reasons:
- Retain custom board option selections for a given board
- Retain board selection for a given sketch
Custom board options may change from one platform release to another.
🐛 If the user updates to a version of a platform where a previous custom board option is not present, Arduino IDE continues to use the stored FQBN with custom board options based on the previously used version of the platform, which is invalid for use with the new platform version. This causes compilation and upload operations to fail.
To reproduce
- Select File > New Sketch from the Arduino IDE menus.
- Open the "Boards Manager" view.
- Scroll down until you see the "Arduino Mbed OS Portenta Boards" platform entry.
- If it is not already installed, click the INSTALL button and wait for the installation to finish.
- Select Tools > Board > Arduino Mbed OS Portenta Boards > Arduino Portenta H7 from the Arduino IDE menus.
- Select Sketch > Verify/Compile from the Arduino IDE menus.
- Wait for the compilation process to finish.
🙂 The process is successful as expected. - In the "Arduino Mbed OS Portenta Boards" platform entry in the "Boards Manager" view, select "2.4.1" from the version menu.
- Click the INSTALL button.
- Wait for the install operation to finish.
- Select Sketch > Verify/Compile from the Arduino IDE menus.
🐛 The compilation process fails unexpectedly with the error:Arduino IDE is attempting to compile with an FQBN like:Error resolving FQBN: getting build properties for board arduino:mbed_portenta:envie_m7: invalid option 'security' Compilation error: Error resolving FQBN: getting build properties for board arduino:mbed_portenta:envie_m7: invalid option 'security'
arduino:mbed_portenta:envie_m7:split=50_50,security=none
- Open the Tools menu.
🐛 The menu contains "Flash split" and "Security setting" submenus even though version 2.4.1 of the "Arduino Mbed OS Portenta Boards" platform does not define these custom board options.
Expected behavior
Arduino IDE uses a valid FQBN for all operations even when the custom board options of a board have changed.
Note that, in addition to updates via Boards Manager, these changes may occur due to the user modifying or manually updating installed platforms between Arduino IDE sessions, so the Boards Manager update operation can not be used as the trigger to update the stored FQBN.
Arduino IDE version
Operating system
Windows
Operating system version
10
Additional context
Other than the workaround described below, I have not found any way to recover Arduino IDE from this state. The error continues even after opening a new window, restarting the IDE, or re-selecting the board.
In order to make it more simple by using a platform from the primary package index, the demo used a roll back to a previous version of a platform to produce the required conditions. However, the fault also occurs for the more common use pattern of updating to a newer version of an installed platform if a custom board option was removed in that version (real world example here
In the demo, the fault was triggered by the removal of a custom board option menu entirely. However, the fault can also occur if only the previously selected option within a menu was removed by the update, even if the new platform version still contains that board option menu. In this case, the error message will have this form:
Error resolving FQBN: getting build properties for board per1234:avr:foo: invalid value 'a' for option 'bar'
Compilation error: Error resolving FQBN: getting build properties for board per1234:avr:foo: invalid value 'a' for option 'bar'
Possibly related: #1030
Originally reported at https://forum.arduino.cc/t/2-0-3-compilation-error-invalid-option-softdevice/1063253
Workaround
-
Select File > Quit (or Arduino > Quit Arduino for macOS users) from the Arduino IDE menus if it is running.
-
Delete the following folder to clear the incorrect FQBN from Arduino IDE's data store:
- Windows:
(where
C:\Users\<username>\AppData\Roaming\arduino-ide\
<username>
is your Windows username)
❗ If looking for it with your file manager or command line, note that theAppData
folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items". - Linux:
(where
/home/<username>/.config/arduino-ide/
<username>
is your Linux username)
❗ The.config
folder may be hidden by default in your file manager and terminal. - macOS:
(where
/Users/<username>/Library/Application Support/arduino-ide/
<username>
is your macOS username)
❗ TheLibrary
folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
⚠ Please be very careful when deleting things from your computer. When in doubt, back up!
- Windows:
-
Start Arduino IDE.
-
Select the board and port from the Arduino IDE menus.
You should now be able to perform whatever action was previously failing with the "getting build properties" error.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details