Hi @sonofcy .
These are not actually board-specific. They are platform-specific. They are all the example sketches of the libraries bundled with the "Arduino UNO R4 Boards " platform. In addition to the Nano R4 , that platform provides support for the UNO R4 WiFi board. For this reason, the "WiFiS3 " library is bundled with the platform, and so that library's examples are shown in the File > Examples menu when any board of the "Arduino UNO R4 Boards " platform is selected in Arduino IDE.
So the "Examples for Arduino Nano R4 " heading in the menu is misleading. I have made a proposal for changing this to an appropriate description of the examples:
opened 02:31PM - 07 Aug 22 UTC
type: enhancement
topic: code
### Describe the request
Change the heading text of the platform bundled librar… ies section of the **File > Examples** menu from the current format:
> Examples for \<board name\>
to:
> Examples for \<platform name\>
🙂 The IDE will no longer make unsubstantiated claims of board-specific compatibility of platform bundled examples to the users accessing them via the **File > Examples** menu.
### Describe the current behavior
The installations of Arduino boards platforms may contain ["platform bundled libraries"](https://arduino.github.io/arduino-cli/dev/platform-specification/#platform-bundled-libraries), which are only accessible when a board of that platform is selected in the Arduino IDE.
The Arduino IDE places the example sketches of platform bundled libraries in a dedicated section under the **File > Examples** menu. The heading text of this section follows the format "Examples for \<board name\>", where "\<board name\>" is the name of the currently selected board. This description is not guaranteed to be correct because all examples of all libraries of the platform are listed here, while the libraries or examples may only be compatible with a specific board of the platform.
There is no mechanism for the Arduino IDE to determine whether a sketch or library is compatible with a specific board.
🙁 The **File > Examples** menu section makes incorrect claims of board compatibility for some platform bundled library examples.
An arbitrary example of this is the ["**SAMD_BootloaderUpdater**"](https://github.com/arduino/ArduinoCore-samd/tree/1.8.13/libraries/SAMD_BootloaderUpdater) library bundled with the official ["**Arduino SAMD (32-bits ARM Cortex-M0+) Boards**"](https://github.com/arduino/ArduinoCore-samd) platform. This library is written to be used only with the ["**MKR Vidor 4000**" board](https://docs.arduino.cc/hardware/mkr-vidor-4000), and attempting to compile its example sketch for any other board [will result in an error](https://github.com/arduino/ArduinoCore-samd/blob/1.8.13/libraries/SAMD_BootloaderUpdater/src/SAMD_BootloaderUpdater.cpp#L29-L33). Yet, the "**UpdateBootloader**" example of this library is described as being "for" the currently selected board even when it is not a **MKR Vidor 4000**.

### Arduino IDE version
2.0.0-rc9.1-snapshot-0b33b51
### Operating system
All
### Operating system version
Any
### Additional context
Real world example of the current menu selection heading causing confusion: https://github.com/arduino/ArduinoCore-mbed/issues/529#issuecomment-1201117968
#### Related
- https://github.com/arduino/arduino-ide/issues/2259
- https://forum.arduino.cc/t/opamp-library-needs-updating-for-nano-r4/1403919/3
- https://forum.arduino.cc/t/several-example-sketches-fail/1405063/4
### Issue checklist
- [X] I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the feature was still missing when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My request contains all necessary details
There is also a proposal for making it possible for compatibility to be specified to a board level granularity in library metadata here:
opened 02:33PM - 17 Apr 23 UTC
type: enhancement
topic: documentation
status: waiting for information
topic: code
phase: design
### Describe the request
Add support for a field named `supported` in [the `lib… rary.properties` library metadata file](https://arduino.github.io/arduino-cli/dev/library-specification/#library-metadata). This field is a comma-separated list of patterns to match against an FQBN.
This will allow library developers to define the supported boards for the library down to board-level granularity.
The result would be something like this in the `library.properties` file:
```text
name=Camera
version=1.0
author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Camera library for Portenta H7 Vision Shield
paragraph=
category=Other
url=https://github.com/arduino/ArduinoCore-mbed/tree/master/libraries/Camera
architectures=mbed,!avr
supported=*:mbed:portenta,!*:*:nano33ble
#supported=mbed:portenta,!mbed:nano33ble <- without wildcards
```
This information could be used for applications such as:
- Accurately populate the "**Compatibility**" lists in [the Arduino Library Reference](https://www.arduino.cc/reference/en/libraries/) (this would require also changing [the **libraries-repository-engine** tool](https://github.com/arduino/libraries-repository-engine) to include the information in [the Library Manager index](http://downloads.arduino.cc/libraries/library_index.json)).
- Select the best library for the selected board during [library discovery](https://arduino.github.io/arduino-cli/dev/sketch-build-process/#dependency-resolution).
- Print a warning when compiling the library for an unsupported board.
- Disallow compilation of the library for boards that are explicitly specified as being unsupported.
### Describe the current behavior
Library developers can only indicate compatibility at architecture-level granularity. A library may have dependencies on attributes that only present on a subset of boards of a given architecture.
This means it is not possible for tools to accurately determine whether a specific board is supported by a library.
For example, the "**Keyboard**" library specifies compatibility with the `avr` architecture:
https://github.com/arduino-libraries/Keyboard/blob/1.0.4/library.properties#L9
```text
architectures=avr, samd, sam
```
However, not all AVR microcontrollers have the required native USB capability. This results in inaccurate information about the library's support for those boards.
The library is listed in `lib list` command output when the FQBN of an unsupported board (e.g., [**Uno**](https://docs.arduino.cc/hardware/uno-rev3)) is specified via the `--fqbn` flag:
```text
$ arduino-cli lib install Keyboard
Downloading Keyboard@1.0.4...
Keyboard@1.0.4 Keyboard@1.0.4 already downloaded
Installing Keyboard@1.0.4...
Installed Keyboard@1.0.4
$ arduino-cli lib list Keyboard --fqbn arduino:avr:uno
Name Installed Available Location Description
Keyboard 1.0.4 - LIBRARY_LOCATION_USER -
```
Unsupported boards are included in the automatically generated "**Compatibility**" list of the library's reference page:
https://www.arduino.cc/reference/en/libraries/keyboard/
### Arduino CLI version
0.32.2
### Operating system
N/A
### Operating system version
N/A
### Additional context
The newly added field should be ignored by versions of Arduino development tools that don't have support for the new field. If so, this change would not result in any backwards incompatibility of the libraries that use it.
---
Relevant code:
https://github.com/arduino/arduino-cli/blob/743c3e9b3c94eded62b44081a03650d571fa230c/arduino/libraries/libraries.go#L78
#### Related
- https://github.com/arduino/Arduino/issues/11871
- https://github.com/arduino/ArduinoCore-mbed/issues/529#issuecomment-1201117968
- https://github.com/arduino/arduino-ide/issues/1304
- https://github.com/arduino-libraries/ArduinoIoTCloud/pull/380#issuecomment-1737244158
- https://forum.arduino.cc/t/documentation-for-keyboard-library-needs-some-correction/1126221
- https://forum.arduino.cc/t/arduino-keyboard-not-working-on-arduino-uno-r3/1102400
- https://forum.arduino.cc/t/sketch-funktioniert-nicht-keyboard/1099364/6
- https://forum.arduino.cc/t/issue-on-keyboard-library/1065385
- https://forum.arduino.cc/t/what-is-wrong-here/1080550/7
- https://forum.arduino.cc/t/comments-on-arduino-1-5-specifications/162030/72 / https://forum.arduino.cc/t/comments-on-arduino-1-5-specifications/162030/83
- https://forum.arduino.cc/t/comments-on-arduino-1-5-specifications/162030/84
- https://forum.arduino.cc/t/opamp-library-needs-updating-for-nano-r4/1403919/3
### Issue checklist
- [X] I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-cli/issues?q=)
- [X] I verified the feature was still missing when using the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
- [X] My request contains all necessary details
If that compatibility information was available, it could be used by Arduino IDE to filter and tailor the content of the "Examples " menu.
As with the examples, the reason is that the "Arduino UNO R4 Boards " platform provides support for the UNO R4 WiFi board. For this reason, it contains files related to Wi-Fi and that board.
1 Like