how to change permanent Arduino IDE COM port?

hi all,

Procured 1 x Arduino Nano 33 BLE,, connected USB cable to the computer, uploaded a simple program and it works fine!

Upon installing Arduino IDE V 1.8.13, the installed USB driver points to COM4 on Windows 10 Pro

Prior to upload, had to set as follows:
Tools -> Port
COM4 (Arduino Nano 33 BLE)

However, whenever I Upload the sketch to the Nano 33 BLE, Arduino IDE changes automatically to
"Arduino Nano 33 BLE on COM3"

then I need to got back to Tools->Port and re-select COM4 (Arduino Nano 33 BLE)

question:
1/ how can I permanently set Arduino IDE to COM4 (Arduino Nano 33 BLE)?

thanks in advance for any help
Trajano

It's impossible. You just need to get used to chasing the port around when using this board.

Some things you might find helpful:

  • Make sure to always close Serial Monitor and Serial Plotter before uploading.
  • Press and release the reset button on the Nano 33 BLE twice quickly to put it in bootloader mode when the upload starts (after you see the sketch memory usage information printed in the console pane of the IDE). This allows you to upload even when the wrong port is selected.

pert:
It's impossible. You just need to get used to chasing the port around when using this board.

Some things you might find helpful:

  • Make sure to always close Serial Monitor and Serial Plotter before uploading.
  • Press and release the reset button on the Nano 33 BLE twice quickly to put it in bootloader mode when the upload starts (after you see the sketch memory usage information printed in the console pane of the IDE). This allows you to upload even when the wrong port is selected.

thanks Pert for the lighting speed response.
understand the work around, but for me it appears weird the IDE not allowing us to select a permanent port
is there any rationale why Arduino IDE keeps going back to COM3?
thanks
Trajano

The way uploads to the native USB boards like the Nano 33 BLE work is:

  • The Arduino IDE sends a signal for the nRF52840 microcontroller to reset.
  • The microcontroller resets.
  • The bootloader program starts.
  • The bootloader program creates a USB CDC serial port.
  • The operating system enumerates the serial port.
  • The upload tool sends the program to the microcontroller, where the bootloader writes it to flash memory.
  • The bootloader program exits.
  • The sketch program starts.
  • The sketch program creates a USB CDC serial port.
  • The operating system enumerates the serial port.

The operating system enumeration process must make sure to always assign a unique serial port to each device. Usually it will end up doing this consistently, so that when a device of with a given USB VID/PID pair is connected, it gets the same COM port as before, so long as there isn't already another device using it (as would happen if you had a device with that VID/PID already connected). The native USB boards have a different VID/PID when the bootloader is running than when the sketch is running, so the upload process looks to the operating system like you unplugged one device, immediately plugged in a different device, unplugged that device, then plugged back in the original device. So this explains why the port number changes during the upload, but for some reason, the OS does not always enumerate the Nano 33 BLE back to the original port number after the upload. This doesn't seem to happen with the other native USB Arduino boards that use the equivalent upload procedure, so I'm not sure what is different about the Nano 33 BLE.

  • Click on the Start Menu, and open up the Control Panel.
  • While in the Control Panel, navigate to System and Security. Next, click on System. Once the System window is up, open the Device Manager.
  • Look under Ports (COM & LPT). You should see an open port named “Arduino UNO (COMxx)”. If there is no COM & LPT section, look under “Other Devices” for “Unknown Device”.
  • Right click on the “Arduino UNO (COmxx)” port and choose the “Update Driver Software” option.
  • Next, choose the “Browse my computer for Driver software” option.
  • Finally, navigate to and select the driver file named “arduino.inf”, located in the “Drivers” folder of the Arduino Software download (not the “FTDI USB Drivers” sub-directory). If you are using an old version of the IDE (1.0.3 or older), choose the Uno driver file named “Arduino UNO.inf”
  • Windows will finish up the driver installation from there.

@sharonvillee

OP does not have an Uno but a Nano BLE Sense..
OP also does not have a driver installation problem.

pert:
So this explains why the port number changes during the upload, but for some reason, the OS does not always enumerate the Nano 33 BLE back to the original port number after the upload. This doesn't seem to happen with the other native USB Arduino boards that use the equivalent upload procedure, so I'm not sure what is different about the Nano 33 BLE.

@all
As Per mostly covered the reason why I will just add a small amount.

It mainly happens when you have 2 or more boards connected and as rightly stated one board may assume the COM port that was already used by the other board.
This would and does on occasion cause a leapfrog effect on the com ports (creeping com port)

So long as the effect is localised to only two com ports this is rarely an issue.
Only when multiple boards (usually also multiple types) are connected can this proliferate into something a little more awkward on occasion. However the fix for the more complicated issue is reasonably simple and well documented from using the search.

There are already a few results for the issue including one that I initially tried of locking the COM ports but now renounce after extensive testing with most of the windows OS's.

@sharonvillee
I would politely suggest reading up on some of those search results.

@traja47
Same advice to you as this is a foible of some (not all ) arduino devices and even some NON Arduino items such as bluetooth and some older cell phones.

ballscrewbob:
@all
As Per mostly covered the reason why I will just add a small amount.

It mainly happens when you have 2 or more boards connected and as rightly stated one board may assume the COM port that was already used by the other board.
This would and does on occasion cause a leapfrog effect on the com ports (creeping com port)

So long as the effect is localised to only two com ports this is rarely an issue.
Only when multiple boards (usually also multiple types) are connected can this proliferate into something a little more awkward on occasion. However the fix for the more complicated issue is reasonably simple and well documented from using the search.

There are already a few results for the issue including one that I initially tried of locking the COM ports but now renounce after extensive testing with most of the windows OS's.

@sharonvillee
I would politely suggest reading up on some of those search results.

@traja47
Same advice to you as this is a foible of some (not all ) arduino devices and even some NON Arduino items such as bluetooth and some older cell phones.

@
ballscrewbob

Sadly, since I've updated the driver on windows 10, Arduino IDE no longer works.
When try to upload the sketch, following error shows up on IDE:

Any suggestions on how to fix?
thanks

ballscrewbob:
Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P"

ballscrewbob:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.

ballscrewbob:
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

ballscrewbob:
An error occurred while uploading the sketch

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x31

ballscrewbob:
avrdude: stk500_recv(): programmer is not responding

ballscrewbob:
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x31

ballscrewbob:
This report would have more information with

ballscrewbob:
"Show verbose output during compilation"

ballscrewbob:
option enabled in File -> Preferences.

FIXED!
I have fixed the problem
An error occurred while uploading the sketch
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x31

For whatever reason, updating the USB driver on windows 10, has somehow corrupted "boards" & "ports" for a particular sketch unless I did myself inadvertently,

anyway, I re-opened the sketch and set
Board: Arduino Nano 33 BLE
Port: COM4 (Arduino Nano 33 BLE)

and upload works fine

thanks
Trajano