COM port use remembering

I discovered another secret of IDE 2.0. It remembers any processor that was connected some time ago and assigns it to all COM ports. No matter which processor is currently connected.
A Nano is currently connected, the "Thinary Nano Every" was used once a few weeks ago.

Hi @RudolfAtRTC. I believe the behavior is explained by this:

https://arduino.github.io/arduino-cli/latest/platform-specification/#board-vidpid

USB vendor IDs (VID) and product IDs (PID) identify USB devices to the computer. If the board uses a unique VID/PID pair, it may be defined in boards.txt:

uno.vid.0=0x2341
uno.pid.0=0x0043
uno.vid.1=0x2341
uno.pid.1=0x0001

The vid and pid properties end with an arbitrary number, which allows multiple VID/PID pairs to be defined for a board. The snippet above is defining the 2341:0043 and 2341:0001 pairs used by Uno boards.

The Arduino development software uses the vid and pid properties to automatically identify the boards connected to the computer. This convenience feature isn't available for boards that don't present a unique VID/PID pair.

and this:

https://github.com/Thinary/ThinaryArduino/blob/master/Thinary-megaavr/boards.txt#L7-L8

nona4808.vid.0=0x1A86
nona4808.pid.0=0x7523

These vid and pid properties are intended to be used to identify boards which have unique VID/PID pairs owned by the board manufacturer, as Arduino has for the official boards.

The Thinary people didn't obtain their own VID/PID pair. They used the default 1A86:7523 provided by the manufacturer of the CH340 USB to serial chip used on the "Thinary Every" board, as well as on many other Arduino boards and other devices. So now once you install their boards platform, every port created by a CH340 will be identified by the Arduino IDE as a "Thinary Every" regardless of whether there really is a Thinary Every on the other end of that chip.

This feature of the Arduino boards platform system was not intended to be used on this type of board. For example, you can see that Arduino did not associate the VID/PID of the general purpose FTDI FT232R chip used on the classic Nano and other older official boards here in the "Arduino AVR Boards" platform:
https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt
It was only done for the boards that use a custom VID/PID (e.g., Uno, Mega, Leonardo).

Not all COM ports. Only the ports from devices that use a CH340 USB to serial adapter.

It must be a derivative Nano that uses the CH340.

Okay, many thanks for the explanation! This peculiarity does not bother very much.

I created a Arduino boards platform that does something similar by associating all the VID/PID pairs of the common general purpose USB to serial chips with dummy boards. I find this very convenient because I have a lot of serial ports on my computer and sometimes I have trouble remembering which one a board is connected to when it is not labeled in the Arduino IDE ports menu. Seeing the chip that produced the port is enough information for me to know which port it is.

I couldn't live without it with the classic Arduino IDE, but I find it too disruptive when using Arduino IDE 2.x because it doesn't play well with the IDE's new board/port menu, which makes more functional use of the board/port association. I guess you might have some similar experiences with your other CH340 boards.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.