Skip to content

"Sketch > Upload" menu item disabled after upload w/ Serial Monitor open #1722

Closed
@per1234

Description

@per1234

Describe the problem

Under certain conditions, the Sketch > Upload and Sketch > Upload Using Programmer menu items are disabled after the completion of an upload:

  • Upload is made to a native USB CDC serial port
  • Serial Monitor is open

To reproduce

Equipment

Any Arduino board that uses a native USB CDC serial port for uploads.

Examples:

  • Leonardo
  • Micro
  • MKR Boards
  • Nano 33 IoT
  • Nano 33 BLE
  • Teensy (only when uploading to the board's port from the "Serial ports" section of the Tools > Port menu)

Steps

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Connect the Arduino board to your computer.
  3. Select the board and port in Arduino IDE.
  4. Open the Serial Monitor view if it is not already open.
  5. Select Sketch > Upload from the Arduino IDE menus.
    The fault also occurs if the upload operation is triggered by clicking the "Upload" button or using the Ctrl+U keyboard shortcut.
  6. Wait for the upload to finish successfully.
  7. Open the Sketch menu.

🐛 The Sketch > Upload and Sketch > Upload Using Programmer menu items are disabled for no good reason:

image

Expected behavior

The Sketch > Upload and Sketch > Upload Using Programmer menu items are only disabled if uploading is impossible. The only conditions under which that would be the case is when no board is selected (and programmer in the case of Upload Using Programmer). However, the Sketch > Upload and Sketch > Upload Using Programmer menu items are even enabled in this case (which is reasonable since it allows the IDE to communicate the requirement of selecting a board and programmer to the user).

Arduino IDE version

d6a4b0f

Operating system

Windows

Operating system version

10

Additional context

The fault first occurs for me with 7d6a2d5 (does not occur when using the build for 6984c52)


I have not been able to reproduce the fault on Linux and the reports have been from Windows users.


I found that the number of platforms installed affects my ability to reproduce the fault. With my full collection of ~40 platforms, I find that the fault only occurs when using ac9cce1 or newer, and that I am unable to reproduce the fault when uploading to a Teensy board even then. So if you are having difficulty reproducing the fault, try a minimal data directory that only contains the single platform of the board you are uploading to.


The upload operation can still be triggered via the Upload button or Ctrl+U keyboard shortcut even after the Sketch > Upload menu item was disabled.


The Sketch > Upload and Sketch > Upload Using Programmer menu items are re-enabled after selecting a different board or port.


The fault does not occur when uploading to boards without a native USB CDC serial port:

  • Uno
  • Mega
  • Nano Every

Originally reported at https://forum.arduino.cc/t/ide-2-0-2-forgets-how-to-upload/1054971/1

Additional reports:

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