Feature Requests

  1. When selecting download, it would make sense to verify if the download port is connected before the build. Since the IDE always does a fresh build it makes sense to abort before spending the time building rather than after;

  2. Place Port Selection on a button on the IDE with the "last used" selection as default. This would save time instead of having to click Tools -> Port -> select port

  3. Have a button on the IDE to reset the target so whatever sequence is used by the downloader would activate reset remotely.

Thanks

Hi @mingbear. Thanks for your suggestions!

During the beta development phase of Arduino IDE 2.x it did work this way. The developers neglected to consider that, in the vast Arduino ecosystem, boards don't always use or require a port to upload. This resulted in the unfortunate user experience of having to select some unrelated port just to make an upload that didn't need a port.

Arduino IDE runs an arbitrary command generated from a pattern defined by the platform developer in order to perform the upload, so it is easiest to allow whatever upload is used for the currently selected board to communicate about the problem in the case where the upload failed due to the user not having selected a port. This does result in the compilation step running before the upload operation can get to the failure point. However, the compilation output is cached, so even when the upload operation fails the compilation step is still productive since the next time the user attempts an upload the source code files will not need to be compiled again and so the duration of the compilation step will be much shorter.

This is essentially how Arduino IDE 2.x works already. In addition to the traditional Tools > Port menu, Arduino IDE 2.x has a "Board Selector" dropdown menu on the toolbar, which allows the user to quickly select not only the port but the board as well!

Arduino IDE 2.x remembers the board and port you had selected the last time you had a given sketch open and selects those by default when you open that sketch. It will also persist the current board and port selection to the new IDE window when you open a new sketch.

The developers are tracking this request here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.

This may be more technically challenging than it might seem at a glance. There are two common mechanisms for software to trigger a reset:

  • Assert DTR
    The Uno, Mega, classic Nano, Pro Mini have an "auto reset" circuit that pulses the reset pin on the primary microcontroller when the DTR control signal line from the USB to serial chip is "asserted" when the port is opened by the AVRDUDE upload tool or Arduino IDE Serial Monitor.
  • 1200 bps "touch"
    The core of the Leonardo, Micro, MKR, Nano 33, and other boards treats a serial connection being opened with communication speed configured for 1200 baud as a special signal. When this occurs, the bootloader is activated. Arduino IDE actually handles this "1200 bps touch" instead of the upload tool.

However, other boards may have any arbitrary external software reset mechanism or none at all. So in order for a reset button in Arduino IDE to work universally, it would be necessary for the 3rd party boards platform developers to define the reset mechanism in their platform configuration.

Thank you for the reply.

I shall try using the board selector dropdown. For some reason it was showing me the wrong board when I was using it. So it would show ESP32C3 Dev Module, but when I wanted to click it it allowed me only the selection of an (IIRC) Adafruit ESP32C3 board. I manually reset it to ESP32C3 Dev Module, closed the IDE and now it shows me ESP32S3 CAM LCD. The hardware shown on the lower right hand side on the IDE always shows (correctly) ESP32C3 Dev Module.

Its behaviour seems relatively random. It might show ESP32C3 Dev Module or a random board when I load the IDE. If it shows ESP32C3 Dev Module, when you click on it it will usually show a different board and you have to essentially find the board again. All the while, the lower right hand corner is correct.

I noticed that behaviour early on and assumed it had some function other than the one you outlined.

Note that I am not using an ESP32 Dev Module but a custom PCB based on ESP32C3WROOM which is essentially the same thing.

Good to hear about the plans for a reset button.

Thanks again.

Despite the name, the "Board Selector" is really a menu that contains a list of the ports detected on your computer. When possible, Arduino IDE associates a board with that port. There are two mechanisms for this association:

  • Identification properties: There may be some identifying information associated with a port. The platform can associate a board definition with this identifying information.
  • User association: If none of the board definitions from the installed platforms match the port's identification properties, the port is associated with the board the user selected last in combination with that port.

Although any arbitrary identification properties are supported by the Arduino platform framework, most platforms use the USB VID/PID pair, as is the case here. It seems the boards based on the ESP32-C3 (and ESP32-S3 as well!) typically have the VID/PID pair 303a:1001. I don't know much about this chip, but I know 0x303a is the VID owned by the chip manufacturer Espressif. So I would guess this is either hardcoded into the ROM or else simply offered as an optional manufacturer provided VID/PID for chip buyers who don't want to procure their own dedicated VID/PID (similar to what FTDI does with the VID/PID on the FT232R chip).

Typically in this case where a property is not uniquely identifying, the platform would not associate it with the board. For example, Arduino does not associate the 0403:6001 VID/PID pair supplied by FTDI for the FT232R chip with definition of the classic Nano board because this would cause the ports of other boards using the FT232R to be incorrectly associated with the Nano board definition in Arduino IDE.

But there is nothing in the Arduino boards platform framework to prevent each platform author from associating non-unique properties with their board definitions. That is what the ESP32 boards platform developers did. They associated many different board definitions with the VID/PID pair 303a:1001. For example:

... and so on.

So it is not clear what Arduino IDE should do in this case. Apparently there is some non-deterministic behavior in terms of which board it chooses to associate when multiple board definitions are configured to associate to the port's identification properties.

In this case unfortunately you will not find the "Board Selector" feature to be useful. Fortunately we have the old reliable Tools > Board, Tools > Port system still available to us for when the fancy new UI falls down when faced with the harsh environment often produced by installing 3rd party Arduino boards platforms which find all sorts of wonderful, strange, and/or ugly ways to use and abuse the framework.

Fair enough, but why does the IDE always show the proper board in the lower right hand corner, but random board in the Board Selector?

Obviously, one part of the IDE gets it right all the time, and the other does not.

Probably because one shows what board you have connected and the other shows what board you want to write code for. You might have an UNO connected, but want to test if your code compiles also for a Leonardo.

No offense but do you want the IDE to be user friendly or not?

If the claim is that the IDE cannot know what ESP device is connected because the VID/PID pair can be mapped to an arbitrarily large set of boards, doesn't it make sense that, instead of randomly selecting a board, using the information provided by the user as a default?

Do you have the port of the board selected in the Tools > Port menu?

The board name shown in the lower right hand corner is the board that is selected in the Tools > Board menu. So reason it gets it right is because you got it right when you manually selected the appropriate board from that menu (or from the alternative interface of the "Select Other Board and Port" dialog). In this case where multiple boards are associated with the identifying properties of a port, there is no way for Arduino IDE to know which is the right board without your assistance.

Lower right hand is always correct, even if cleanly starting the IDE. It even knows the serial port because it says [not connected].

Top Box (usually) shows the correct board, clicking it shows a random board
image

Clicking select other board and port and searching for my board shows my board is already checked but the only com port is not

Obviously the system knows what board I am working with and should select and instead forces me to go through multiple mouse moves and keyboard operations to get there.

Not only that, it sees I have one serial port but forces me to select that.

This happens every time the board is plugged in.

VS Code, at least for Espressif, has an icon for board and an icon for port. It also remembers what was used last. This makes sense because in most cases the user is going to be using the same board and same port rather than randomly changing board and port.

At a minimum there should be a single click "try and reconnect to what was there last time".

The IDE remembers the board you had selected previously.

That is the reason why the Board Selector shows a random board associated with the port. If you select the port you should find that the selected board is associated with that port in the Board Selector.

As I already explained, it only knows that because you already selected the board. There is no way for the IDE to automatically know the board you are working with in this case.

The IDE should not assume that one serial port is the port you want to select. Some boards don't produce a port and forcing a port selection on the user in this case would be wrong. It is better to give the user control.

So does Arduino IDE.

Look. This it futile. You are simply explaining its annoying behaviour rather than trying to understand the issue.

No sense discussing further.

I understand the issue. What you don't understand is that, until such time as software gains mind reading powers, there is no way to implement the feature you are requesting.

If I'm wrong about that, feel free to submit a pull request to make the changes necessary to allow Arduino IDE to magically determine the correct board to associate with the port:

https://github.com/arduino/arduino-ide/blob/main/docs/contributor-guide/pull-requests.md#pull-request-guide

1 Like

@mingbear

Look. This it futile. You are simply explaining its annoying behaviour rather than trying to understand the issue.
No sense discussing further.

you are failing to understand what the UI shows:

Nano RP2040 Connect board connected to USB port, but user last selected Arduino UNO for that Sketch.
Bottom-right such last device is displayed: IDE "remembers"

Selecting the board disovered and displayed in the drop-down will result in this situation.
Bottom-right displays "on /SERIAL/PORT/RESOURCE"

Close the IDE.
Disconnect Nano RP2040, connect UNO, reopen IDE

Last board selected (Nano RP2040) is displayed both in menu and bottom-right
UNO is displayed as available (discovered)

Please do not be dismissive of someone (@pert ) trying to explain you why something is like that, wether or not you like the UX solution.
@Pert is not trying to sell it to you

Thank you for understanding

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