Skip to content

Firmware Updater fails when target port has multiple identifications #2175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
per1234 opened this issue Aug 18, 2023 · 2 comments · Fixed by #2178
Closed
3 tasks done

Firmware Updater fails when target port has multiple identifications #2175

per1234 opened this issue Aug 18, 2023 · 2 comments · Fixed by #2178
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Aug 18, 2023

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 18, 2023
@kittaakos kittaakos self-assigned this Aug 19, 2023
@kittaakos
Copy link
Contributor

11. Attempt to select the target board from the "Select Board" menu in the "WiFi101 / WiFiNINA Firmware Updater" dialog.
🐛 The menu doesn't open.

What do you expect to see in the <select> before confirming the board between steps (12) and (15)? Do you expect to see two board items? This would imply showing 27 different ESP32 boards on the same port in some corner cases. Thank you

@per1234
Copy link
Contributor Author

per1234 commented Aug 19, 2023

Do you expect to see two board items?

The menu should only offer the boards that are supported by Arduino Firmware Uploader:

$ ./arduino-fwuploader.exe firmware list
Board                       FQBN                                Module     Version
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.4.4 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.5.2 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500   19.5.4 
Arduino MKR1000             arduino:samd:mkr1000                WINC1500 ✔ 19.6.1 
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.0.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.1.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.1  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.2  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.3  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.2.4  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.3.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.0  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.1  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.2  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.3  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.4  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.5  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.6  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.7  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA       1.4.8  
Arduino MKR WiFi 1010       arduino:samd:mkrwifi1010            NINA     ✔ 1.5.0  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.0.0  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.1.0  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.2.1  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.2.2  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.2.3  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.2.4  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.3.0  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.0  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.1  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.2  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.3  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.4  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.5  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.6  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.7  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA       1.4.8  
Arduino NANO 33 IoT         arduino:samd:nano_33_iot            NINA     ✔ 1.5.0  
Arduino MKR Vidor 4000      arduino:samd:mkrvidor4000           NINA       1.0.0  
Arduino MKR Vidor 4000      arduino:samd:mkrvidor4000           NINA     ✔ 1.1.0  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.2.1  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.2.2  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.2.3  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.2.4  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.3.0  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.0  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.1  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.2  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.3  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.4  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.5  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.6  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.7  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA       1.4.8  
Arduino Uno WiFi Rev2       arduino:megaavr:uno2018             NINA     ✔ 1.5.0  
Arduino Nano RP2040 Connect arduino:mbed_nano:nanorp2040connect NINA       1.4.5  
Arduino Nano RP2040 Connect arduino:mbed_nano:nanorp2040connect NINA       1.4.6  
Arduino Nano RP2040 Connect arduino:mbed_nano:nanorp2040connect NINA       1.4.7  
Arduino Nano RP2040 Connect arduino:mbed_nano:nanorp2040connect NINA       1.4.8  
Arduino Nano RP2040 Connect arduino:mbed_nano:nanorp2040connect NINA     ✔ 1.5.0  
Arduino UNO R4 WiFi         arduino:renesas_uno:unor4wifi       ESP32-S3   0.1.0  
Arduino UNO R4 WiFi         arduino:renesas_uno:unor4wifi       ESP32-S3   0.2.0  
Arduino UNO R4 WiFi         arduino:renesas_uno:unor4wifi       ESP32-S3 ✔ 0.2.1  

Even when there are multiple board identifications for a port in general, it is likely that only one of those will ever be supported by the Firmware Updater. Even if at some point in the future there was a situation where the tool supported multiple boards that shared the same port identification properties, as long as the boards supported by tool continues to be curated by Arduino, there would never be a case where there was a problematic number of supported boards for a given port.

In the demo I provided, there are two general identifications for the port (e.g., arduino:renesas_uno:unor4wifi, fwuploader-board-dummies:foo:unor4wifi), but only one of the identifications is for a board supported by the Firmware Uploader.

kittaakos pushed a commit that referenced this issue Aug 19, 2023
moved the board inference logic from UI to  model

Closes #2175

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Aug 20, 2023
moved the board inference logic from UI to  model

Closes #2175

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants