I am having trouble compiling under MacOS BigSur (11.7.10) with IDE 2.3.7.
Sketch "A" has been compiled multiple times with Espressif's ESP32 version 2.0.17 and the latest version 3.3.5.
Sketch "B" has only been compiled with version 3.3.5.
The problem is that sketch "A" compiles successfully with version 2.0.17, while sketch "B" fails to compile with the following error:
Invalid FQBN: getting build properties for board esp32:esp32:esp32: invalid option 'ZigbeeMode'
Compilation error: Invalid FQBN: getting build properties for board esp32:esp32:esp32: invalid option 'ZigbeeMode'
I select "ESP32 Dev Module " for both. Below is a comparison of the Tools menu under 2.0.17.
Comparing the boards.txt files for versions 2.0.17 and 3.3.5, there are some differences, but the Zigbee related items have definitely been added.
esp32.menu.ZigbeeMode.default=Disabled
esp32.menu.ZigbeeMode.default.build.zigbee_mode=
esp32.menu.ZigbeeMode.default.build.zigbee_libs=
esp32.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router)
esp32.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
But why are 3.3.5 settings being used under 2.0.17?
I thought maybe the compilation information was being cached, so I deleted ~/Library/Caches/arduino, but the problem persists.
I would like to know how to compile project "B" with 2.0.17.
I don't think I had this experience with IDE 2.3.4.
Thanks in advance.
sounds like some hidden build folder needs to be cleared for the project..
turn verbose on for compile and see if prints the location..
then close Arduino, delete that hidden folder, should be recreated..
good luck.. ~q
Hi @embeddedkiddie . The Arduino IDE developers are tracking this bug here:
opened 11:42AM - 11 Dec 22 UTC
topic: code
type: imperfection
### Describe the problem
Arduino boards platform authors can define arbitrary… [custom board options](https://arduino.github.io/arduino-cli/dev/platform-specification/#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:
```text
<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
1. Select **File > New Sketch** from the Arduino IDE menus.
1. Open the "**Boards Manager**" view.
1. Scroll down until you see the "**Arduino Mbed OS Portenta Boards**" platform entry.
1. If it is not already installed, click the <kbd>**INSTALL**</kbd> button and wait for the installation to finish.
1. Select **Tools > Board > Arduino Mbed OS Portenta Boards > Arduino Portenta H7** from the Arduino IDE menus.
1. Select **Sketch > Verify/Compile** from the Arduino IDE menus.
1. Wait for the compilation process to finish.
🙂 The process is successful as expected.
1. In the "**Arduino Mbed OS Portenta Boards**" platform entry in the "**Boards Manager**" view, select "**2.4.1**" from the version menu.
1. Click the <kbd>**INSTALL**</kbd> button.
1. Wait for the install operation to finish.
1. Select **Sketch > Verify/Compile** from the Arduino IDE menus.
🐛 The compilation process fails unexpectedly with the error:
```text
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 IDE is attempting to compile with an FQBN like: `arduino:mbed_portenta:envie_m7:split=50_50,security=none`
1. 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
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](https://forum.arduino.cc/t/2-0-3-compilation-error-invalid-option-softdevice/1063253)
---
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:
```text
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: https://github.com/arduino/arduino-ide/issues/1030
---
Originally reported at https://forum.arduino.cc/t/2-0-3-compilation-error-invalid-option-softdevice/1063253
---
#### Workaround
1. Select **File > Quit** (or **Arduino > Quit Arduino** for macOS users) from the Arduino IDE menus if it is running.
1. Delete the following folder to clear the incorrect FQBN from Arduino IDE's data store:
- Windows:
```text
C:\Users\<username>\AppData\Roaming\arduino-ide\
```
(where `<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**"](https://support.microsoft.com/windows/find-and-open-file-explorer-ef370130-1cca-9dc5-e0df-2f7416fe1cb1), you can make it visible by opening the "**View**" menu, then checking the box next to "**☐ Hidden items**".
- Linux:
```text
/home/<username>/.config/arduino-ide/
```
(where `<username>` is your Linux username)
❗ The `.config` folder may be hidden by default in your file manager and terminal.
- macOS:
```text
/Users/<username>/Library/Application Support/arduino-ide/
```
(where `<username>` is your macOS username)
❗ The `Library` folder is hidden by default. You can make it visible by pressing the <kbd>**Command**</kbd>+<kbd>**Shift**</kbd>+<kbd>**.**</kbd> keyboard shortcut.
⚠ Please be very careful when deleting things from your computer. When in doubt, back up!
1. Start Arduino IDE.
1. 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
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
It can be worked around by following this procedure:
Select Arduino IDE > Quit Arduino IDE from the Arduino IDE menus if it is running.
All Arduino IDE windows will close and the application will be exited.
Delete the folder at the following path:/Users/<username>/Library/Application Support/arduino-ide/
(where <username> is your macOS username)
The /Users/<username>/Library/ folder is hidden by default. You can make it visible by pressing the Command +Shift +. keyboard shortcut.
Please be careful when deleting things from your computer. When in doubt, back up!
Start Arduino IDE.
@qubits-us ,
Thank you for your comment. I always enable verbose when compiling. The FQBN error occurred immediately after the compilation started like this:
@ptillisch ,
Thank you for the solution that allows sketch 'B' to compile successfully with 2.0.17.
It is not currently a problem for me, but I would like to add that after executing 3., the following error was displayed in the Output Monitor:
Platform arduino:avr@1.8.6 already installed
Already installed Ethernet@2.0.2
Already installed Firmata@2.5.9
Already installed Mouse@1.0.1
Failed to install library: 'Arduino_BuiltIn:1.0.0'.
Error: 2 UNKNOWN: Library Keyboard@1.0.6 is already installed, but with a different version: Keyboard@1.0.5
Anyway, I marked this thread as resolved.
Thank you all.
Edit: I found the official document about "User data folder".
https://support.arduino.cc/hc/en-us/articles/4415103213714-Find-sketches-libraries-board-cores-and-other-files-on-your-computer
It says "Removing this folder can sometimes resolve problems with Arduino IDE. "
1 Like
You are welcome. I'm glad it is working now.
This is expected. On the first run after a fresh installation, Arduino IDE automatically installs a collection of foundational libraries (these are referred to as the "built-in libraries". It then sets a flag so that it won't attempt to install them over again. That flag is stored in the data files under the "User data folder". So when you delete the folder, you simulate the fresh install conditions, and thus Arduino IDE attempts to install the built-in libraries again.
Arduino IDE is intentionally configured to not install each library if it finds that you already have an existing installation. The reason for this is the assumption is that if the user already has an installation of the library, they want to use that specific installation and would be unhappy if Arduino IDE automagically made another installation, which might be different and thus cause problems if used to compile the user's projects.
Installation of libraries is performed for Arduino IDE by a helper tool named Arduino CLI . Unfortunately Arduino CLI treats the skipping of installation of existing libraries as an error condition, which causes these confusing messages in Arduino IDE's "Output" panel under these conditions. The treatment as an error makes sense in the context of someone manually running Arduino CLI from the command line, since in that case they explicitly instructed Arduino CLI to install the library and thus the cancellation of that operation is likely to be unexpected. However, it doesn't make sense in the context of Arduino IDE automagically performing this operation for the user.
That said, this first run installation of the built-in libraries is something that will normally only ever occur once on each user's system. And it is increasingly rare that there would be existing library installations. It is true that these conditions may be present on the systems of users migrating from Arduino IDE 1.x to 2.x. However, since Arduino IDE was replaced over three years ago we expect that all beginners will start from Arduino IDE 2.x, and thus will not encounter these error messages. So there is little return on investment for allocating limited resources to polishing this user experience for the small portion of the user base who are finally now upgrading from 1.x to 2.x after years of deferring.
Thank you for the detailed explanation. Now I understand!