Description
Describe the problem
For certain types of boards or ports, the port may alternately disappear and reappear during the course of the upload, sometimes even changing address.
Arduino IDE is designed to select the correct port of the board at the completion of the upload in order to avoid the confusion or inconvenience that would be imposed on the user otherwise.
🐛 When using a teensy
protocol port of a Teensy board, the port selection is sometimes lost after an upload.
To reproduce
Equipment
- Any Teensy board
Steps
- Select File > New Sketch from the Arduino IDE menus.
ⓘ The purpose of this step is to make sure the sketch in use will compile so that the upload operation can proceed. - Connect a Teensy board to your computer.
- Select the port of the board from the "Teensy ports" section of the Tools > Port menu in the Arduino IDE.
❗ The board may also add a port under the "Serial ports" section of the Tools > Port menu. Make sure to select the Teensy port instead.
- Select the board from the Tools > Board menu in the Arduino IDE.
- Select Sketch > Upload from the Arduino IDE menus.
- Select Tools > Port from the Arduino IDE menus.
🐛 The port is no longer selected.
Expected behavior
Port selection is always preserved through the upload.
Arduino IDE version
Original report
2.0.0-rc9.2.snapshot-34a7fdb
Last verified with
Operating system
Windows, Linux
Operating system version
Windows 10, Ubuntu 20.04
Additional context
I bisected the introduction of the bug to #1332 (it does not occur when using the build from d674ab9)
I found the problem occurred intermittently.
I found a correlation between the occurrence of the bug and the behavior of the port during the upload.
On the uploads where the bug occurred, there were always remove/add events for the teensy
protocol port of the board.
On the uploads where the bug did not occur, there were never any remove/add events for the teensy
protocol port of the board.
Example arduino-cli board list --format json --watch
output from an upload when the bug occurred:
{
"type": "remove",
"address": "usb:0/1A0000/0/1/5/1/1/3",
"protocol": "teensy",
"properties": {}
}
{
"type": "add",
"address": "usb:0/1A0000/0/1/5/1/1/3",
"label": "hid#vid_16c0\u0026pid_0478 Bootloader",
"protocol": "teensy",
"protocol_label": "Teensy Ports",
"properties": {
"modelID": "0x25",
"name": "Teensy 4.1",
"serialNumber": "808372"
},
"boards": [
{
"name": "Teensy 4.1",
"fqbn": "teensy:avr:teensy41"
}
]
}
{
"type": "remove",
"address": "usb:0/1A0000/0/1/5/1/1/3",
"protocol": "teensy",
"properties": {}
}
{
"type": "add",
"address": "usb:0/1A0000/0/1/5/1/1/3",
"label": "hid#vid_16c0\u0026pid_0486 RawHID",
"protocol": "teensy",
"protocol_label": "Teensy Ports",
"properties": {
"modelID": "0x25",
"name": "Teensy 4.1",
"serialNumber": "808372",
"usbtype": "USB_RAWHID"
},
"boards": [
{
"name": "Teensy 4.1",
"fqbn": "teensy:avr:teensy41"
}
]
}
Here is the output directly from the teensy-discovery pluggable discovery tool during the same upload:
{
"eventType": "remove",
"port": {
"address": "usb:0/1A0000/0/1/5/1/1/3",
"protocol": "teensy"
}
}
{
"eventType": "add",
"port": {
"address": "usb:0/1A0000/0/1/5/1/1/3",
"label": "hid#vid_16c0&pid_0478 Bootloader",
"protocol": "teensy",
"protocolLabel": "Teensy Ports",
"properties": {
"modelID": "0x25",
"serialNumber": "808372",
"name": "Teensy 4.1"
}
}
}
{
"eventType": "remove",
"port": {
"address": "usb:0/1A0000/0/1/5/1/1/3",
"protocol": "teensy"
}
}
{
"eventType": "add",
"port": {
"address": "usb:0/1A0000/0/1/5/1/1/3",
"label": "hid#vid_16c0&pid_0486 RawHID",
"protocol": "teensy",
"protocolLabel": "Teensy Ports",
"properties": {
"modelID": "0x25",
"usbtype": "USB_RAWHID",
"serialNumber": "808372",
"name": "Teensy 4.1"
}
}
}
Originally reported by @KurtE at https://forum.arduino.cc/t/serial-monitor-issues-hopefully-fixed-before-release/1026548
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