Invalid FQBN used after updating to platform version without previously used custom board option #1762
Open
3 tasks done
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
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:
Arduino IDE stores the FQBN data for a couple of reasons:
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
🙂 The process is successful as expected.
🐛 The compilation process fails unexpectedly with the error:
arduino:mbed_portenta:envie_m7:split=50_50,security=none
🐛 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
f8c01e3
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:
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:
<username>
is your Windows username)❗ If looking for it with your file manager or command line, note that the
AppData
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".<username>
is your Linux username)❗ The
.config
folder may be hidden by default in your file manager and terminal.<username>
is your macOS username)❗ The
Library
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!
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
The text was updated successfully, but these errors were encountered: