The following board librariy and board selection cause compile errors even for empty sketch.
OS : Windows 11
IDE: Arduino IDE 2.0.3
Board Library : Seeed nRF52 mbed-enabled Boards 2.7.2
Board select : Seeed XIAO BLE Sense - nRF52840
Compilation error: Error resolving FQBN: getting build properties for board Seeeduino:mbed:xiaonRF52840Sense: invalid option 'softdevice'
Curiously, no compilation error occurs when "Seeed XIAO BLE - nRF52840" is selected. Also, if I use Arduino IDE 1.8.19, no compile error occurs.
Please advise how to deal with this.
msfujino:
softdevice
Hi @msfujino . I have version 2.7.2 of the "Seeed nRF52 mbed-enabled Boards " platform installed just like you do, but when I look in the boards.txt
file, there is no softdevice
option.
Have you made any modifications to the boards.txt
file?
Have you added a boards.local.txt
file?
Hi ptillisch Arduino Team,
What I checked.
there is no "softdevice" in /AppData/Local/Arduino15/packages/Seeeduino/hardware/boards.txt, and it has not been changed.
There is no "boards.local.txt" in /AppData/Local/Arduino15/packages/Seeeduino/hardware/.
Uninstall IDE2.0.3, delete /Documents/Arduinod directory, install IDE2.0.3 in C:/Program files/, install only board library 2.7.2, and compile empty sketch ----> compile error
Install IDE2.0.3 and board library 2.7.2 on another PC (win10) and compile empty sketch ---->compilation completed!!
From these results, I know the problem is on my Win11 PC, but I can't imagine where the compile option is referenced, only when XIAO_BLE_Sense is selected.
Any ideas?
Excellent work on investigating the problem!
The file should be at this path:
/AppData/Local/Arduino15/packages/Seeeduino/hardware/mbed/2.7.2/boards.txt
(note the mbed/2.7.2/
part of the path)
Is that where you looked?
My apologies. The path is an error in my description.
I correct it as follows.
there is no "softdevice" in /AppData/Local/Arduino15/packages/Seeeduino/hardware/mbed/2.7.2/boards.txt, and it has not been changed.
There is no "boards.local.txt" in /AppData/Local/Arduino15/packages/Seeeduino/hardware/mbed/2.7.2.
OK, I was able to find the cause of the problem.
Version 1.0.0 of the "Seeed nRF52 mbed-enabled Boards " platform did have a softdevice
custom board option . Arduino IDE remembers the previously selected options for convenience so that you don't need to reconfigure the board every time you select it. Unfortunately, this causes a bug where Arduino IDE continues to try to use that option even after you update to a different version of a platform that doesn't have the option anymore. This is why you now get that error message when compiling.
I have submitted a formal bug report to the Arduino IDE developers:
opened 11:42AM - 11 Dec 22 UTC
topic: code
type: imperfection
Compilation fails after updating to platform version with different custom board… options
### 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 (M7 core)** 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** 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:
```
C:\Users\<user name>\AppData\Roaming\arduino-ide
```
- Linux:
```
~/.config/arduino-ide
```
- macOS:
```
~/Library/Application Support/arduino-ide
```
⚠ Please be very careful when deleting things from your computer. When in doubt, back up!
1. Start Arduino IDE.
1. Select the board again.
1. Retry whatever operation that failed previously.
### 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
I'll share the workaround you can use to get Arduino IDE working again:
Select File > Quit from the Arduino IDE menus if it is running.
Delete the following folder to clear the incorrect FQBN from Arduino IDE's data store:
Please be very careful when deleting things from your computer. When in doubt, back up!
Start Arduino IDE.
Select the board again.
Retry whatever operation that failed previously.
Deleting the C:\Users\<user name>\AppData\Roaming\arduino-ide
folder will cause Arduino IDE to forget some convenience information like the board options you had selected before, and it will cause it to run some setup processes that normally only occur on the first run of a fresh installation, but no essential data is stored in that folder so you don't need to worry about this causing the loss of anything essential.
Please let me know if you have any questions or problems while following those instructions.
1 Like
I deleted the arduino-ide folder as instructed. The compilation error no longer occurs.
However, I got an error "property 'upload.tool.serial' is undefined" during uploading, but I was able to work around it by adding "xiaonRF52840Sense.upload.tool.default=nrfutil" in the boards.txt file.
Thanks for your quick response.
You are welcome. I'm glad it is working now.
Great work finding the solution to that other bug. By the way, just today I submitted a fix for that "upload.tool.serial" bug to Seeed:
Seeed-Studio:master
← per1234:fix-upload_tool
opened 01:00PM - 11 Dec 22 UTC
A new flexible and powerful ["pluggable discovery" system](https://arduino.githu… b.io/arduino-cli/latest/platform-specification/#pluggable-discovery) was added to the Arduino boards platform framework. This system makes it easy for Arduino boards platform authors to use any arbitrary communication channel between the board and development tools.
Boards platform configurations that use the old property syntax are automatically translated to the new syntax by Arduino CLI:
https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-upload-configuration
> For backward compatibility with IDE 1.8.15 and older the previous syntax is still supported
This translation is only done in platforms that use the old syntax exclusively. If `pluggable_discovery` properties are defined for the platform then the new pluggable discovery-style `upload.tool.<protocol_name>` properties must be defined for each board as well.
This platform uses the new pluggable discovery platform properties syntax, so those properties are required.
The required properties are missing, which causes uploads to fail for users of the recent versions of Arduino IDE and Arduino CLI (https://github.com/Seeed-Studio/ArduinoCore-mbed/issues/11) with an error of the form:
```text
Error during Upload: Property 'upload.tool.<protocol_name>' is undefined
```
(where `<protocol_name>` is the protocol of the selected port, if any)
It is also important to provide compatibility with versions of Arduino development tools from before the introduction of the modern pluggable discovery system. For this reason, the old style `<board ID>.upload.tool` properties are retained. Old versions of the development tools will treat the `<board ID>.upload.tool.<protocol_name>` properties as an unused arbitrary user defined property with no special significance and the new versions of the development tools will do the same for the `<board ID>.upload.tool` properties.
---
Originally reported at:
- https://github.com/Seeed-Studio/ArduinoCore-mbed/issues/11
- https://forum.arduino.cc/t/2-0-3-compilation-error-invalid-option-softdevice/1063253/7
- https://forum.arduino.cc/t/xiao-boards-property-upload-tool-serial-is-undefined/1035010/1
- https://forum.arduino.cc/t/xiao-boards-property-upload-tool-serial-is-undefined/1035010/11
- https://forum.arduino.cc/t/xiao-boards-property-upload-tool-serial-is-undefined/1035010/14
- https://forum.arduino.cc/t/xiao-boards-property-upload-tool-serial-is-undefined/1064096
---
Fixes https://github.com/Seeed-Studio/ArduinoCore-mbed/issues/11
Hopefully they will merge that PR and make a new release with the fix soon.
Regards,
Per
1 Like
system
Closed
June 9, 2023, 11:31pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.