Skip to content

Firmware Updater fails when target port has multiple identifications #2175

Closed
@per1234

Description

@per1234

Describe the problem

Arduino boards platforms may associate a board definition with port identification properties. Arduino IDE identifies a port as being that board when the port has these properties.

The platform framework doesn't provide any mechanism for restricting the association of a given set of identification properties to a single board definition, so it is possible (and even inherent to some use cases) for a port to be identified with multiple board definitions.

🐛 If the port of the target board is identified with multiple board definitions, the Firmware Updater fails.

To reproduce

Equipment

One of the boards supported by the "WiFi101 / WiFiNINA Firmware Updater" feature:

Steps

  1. Select File > Quit (or Arduino IDE > Quit Arduino IDE for macOS users) from the Arduino IDE menus if it is running.
  2. Click the following link to download the dummy boards platform used to efficiently create the conditions required to produce the fault:
    hardware.zip
  3. Unzip the downloaded file to your sketchbook folder.
    The folder structure should look like this:
    <sketchbook location>/
    ├── hardware/
    │   └── fwuploader-board-dummies/
    │       └── foo/
    │           └── boards.txt
    [...]
    
  4. Start Arduino IDE.
  5. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  6. Select "Developer (Arduino): Clear the Board and Port Selection" from the Command Palette menu.
  7. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  8. Select "Developer (Arduino): Clear the Board List History" from the Command Palette menu.
    This and the three steps before are not required to reproduce the fault that is the primary subject of this report. They are included in order to demonstrate a related fault associated with the conditions of using "WiFi101 / WiFiNINA Firmware Updater" when there are multiple identifications of the target port.
  9. Connect the firmware update target board to your computer with a USB cable if it is not already.
  10. Select Tools > WiFi101 / WiFiNINA Firmware Updater from the Arduino IDE menus.
    The "WiFi101 / WiFiNINA Firmware Updater" dialog will open.
  11. Attempt to select the target board from the "Select Board" menu in the "WiFi101 / WiFiNINA Firmware Updater" dialog.
    🐛 The menu doesn't open.
  12. Close the "WiFi101 / WiFiNINA Firmware Updater" dialog.
  13. Select the port of the target board from the Board Selector menu on the Arduino IDE toolbar.
    The "Select Other Board and Port" dialog will open.
  14. Select the board name that does not have a "(dummy)" suffix from the "BOARDS" menu.
  15. Click the "OK" button.
  16. Select Tools > WiFi101 / WiFiNINA Firmware Updater from the Arduino IDE menus.
  17. Select the target board from the "Select Board" menu in the "WiFi101 / WiFiNINA Firmware Updater" dialog.
  18. Click the "CHECK UPDATES" button.
  19. Click the "INSTALL" button.

🐛 The update process immediately fails:

⚠ Installation failed. Please try again.

Clean up

  1. Delete the folder of the dummy platform at the hardware/fwuploader-board-dummies subfolder of your sketchbook folder.

Expected behavior

It is possible to update firmware on target boards for which the port has multiple identifications.

Arduino IDE version

69ae38e

Operating system

Windows

Operating system version

11

Additional context

I bisected the regression to 69ae38e (neither of the faults occur when using the build from the previous commit 9a6a457 under the same conditions).


The minimal "dummy" boards platform used to produce the required conditions in the demo is not anything a real user would have installed, but the fault also occurs in the more common (but more work to reproduce) conditions of having an additional real boards platform installed that associates a board definition with the identification properties of the target board's port. A real world example of this would be having both a release version and a development version of a platform installed at the same time, as is common for platform developers and beta testers.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions