USB Com port on Nano 33 BLE disconnects on upload

Every time I upload a sketch to the nano 33 ble the COM port disconnects after the upload is complete, is this expected behaviour, it means I have to reselect the com port or the next upload will fail? This dose not happen on other Arduino boards. I have also had a situation ware I end up with multiple entries for the same com port in the com port menu.

This is not the end of the world but it’s very annoying especially when I forget and have to recompile as the nano33 ble takes a long time.

Using the installed version of Arduino IDE 1.8.12 on windows 10

The change uf USB ports is well documented ibn many different posts.
Pretty sure it is also mentioned in some of the ones you may have skipped past too.

Double check that it is not simply the bootloader port (expected).
Then add any additional details (as mentioned in the top posts)

Bob.

Thanks Bob for the reply.
Yes, it is defiantly the boot loader doing this but it is the Arduino IDE not coping with the change correctly. On my system the Arduino uses port 8, with port 8 selected in the tools menu when an upload is performed the port changes to port 6 and the upload continues as normal, at the end of a successful upload the port changes back to 8 but does not get selected in the tools menu(this means that if you don’t manually select the port again the next upload will fail) , surly port 8 should automatically be selected in the tools menu as then no-one would even know or care about the changing com ports.
I have checked other posts but can’t find anything directly showing this, most seem to be about when doble pressing the reset button (I am not doing that). One did say that the IDE should cope with changing the ports.

Thanks.

It should revert to its original (non bootloader) port as you have noticed.

The IDE seems to be the issue there.
This used to happen a little bit with the 101 boards but was fixed quite some time ago.

I would reccomend opening an issue for the IDE on github for this one as I dont have any more on the problem.

Bob.

I still have an issue with this. I have to upload each sketch twice. The first time always fails, but after selecting the new COM port the board has appeared on I recompile/upload and then it works. I am opening the Serial Monitor each time to initiate my test sketches and read the log info. I have to change the COM port each time before I open the Serial Monitor as well.

Does anyone have a workaround for this annoying behaviour? I am on Windows 10.

@pmap

Before you UPLOAD do the double tap to the reset to put it into bootloader mode.
Upload as normal after which it should revert to its proper port.

As I said in the answers above your Q.

Double com ports are EXPECTED with some boards and more so the newer NANO's and MKR's.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

pmap:
Does anyone have a workaround for this annoying behaviour? I am on Windows 10.

This problem has been bugging me for quite some time as well.
I wrote a workaround here

Since a few weeks there has been an update in the IDE, which made the problem a lot less annoying. Still not ideal but workable. I suggest to update your IDE first.

perhaps a bit of an update:

I am on IDE 1.8.13, latest libraries installed for the Nano, and what seems to work for me is to always make sure the COM port (COM9 in my case) is selected before I click on the Upload button in the GUI to compile & upload the code.

If I do that I don't have to upload twice, works fine.

For the serial monitor to work more or less like the Uno, etc., I add this code:

Serial.begin(115200);
while(!Serial); // for Nano 33 serial port change

After upload completes I go to the Tools menu and select COM10 (new port), then launch the serial monitor as always from the button in the upper right corner of the IDE GUI.

The Nano waits until I'm connected, then proceeds from there.

Works fine for what I need.

I should add, as others have pointed out, that if you don't launch the serial monitor with the above the code never starts.

I use a debug mode variable to control this so that I can run my robot untethered as needed:

int debugMode = 1; // 0 = no serial monitor, 1 = add serial monitor messages, 2 = add time delays, 3 = add stops at each pose

void setup() {

if (debugMode >= 1) {
Serial.begin(115200); // be sure serial monitor is set for 'newline' line ending??
while(!Serial); // for Nano 33 serial port change?