Cannot get Arduino Nano 33 BLE to upload sketches

I'm new to Arduino but have been using an Uno successfully for a few days. I just got a Nano 33 BLE and it is doing all sorts of weird things when I try to upload sketches. Here are some example steps:

  • I installed fresh Arduino IDE after uninstalling and deleting "Arduino15" folder.
  • I installed "Arduino nRF528x Boards (Mbed OS)" version 1.1.2 to get support for Arduino Nano 33 BLE board.
  • I plugged in the Nano 33 BLE via USB.
  • Under "Device Manager > Ports (COM & LPT)," a new "USB Serial Device (COM5)" item shows up.
  • I choose my board and port under the Tools menu. Note that "COM5 (Arduino Nano 33 BLE)" was the only option.
  • I try to upload a sketch.
  • Compilation takes way longer than it used to with the Uno, but I'll worry about that later.

Once it starts uploading the weirdness begins…

  • I hear the Windows "hardware just got added/removed" noise.
  • Under "Device Manager > Ports (COM & LPT)," "USB Serial Device (COM5)" changes to COM4.
  • I hear the Windows "hardware just got added/removed" again.
  • Under "Device Manager > Ports (COM & LPT)," "COM4" changes back to "USB Serial Device (COM5)."
  • The bottom right of Arduinio IDE changes from "Arduino Nano 33 BLE on COM5" to "Arduino Nano 33 BLE on COM4."
  • I get errors about not being able to connect to the COM port e.g. "Error opening serial port 'COM5'." or "Error while setting serial port parameters: 9,600 N 8 1"
  • Sometimes my selection of the port under the Tools menu will just go away (back to just the word "Port" with sub menu).
  • Sometimes I get duplicates in the "Tools > Port" menu like having two COM4 entries and one COM5 entry.
  • Somehow, magically, the board gets programmed occasionally, but not usually.

I'm using Windows 10 with the latest updates.

Note: Everything works fine if I use the online IDE. The COM port under device manager does the same thing where it switches from COM5 to 4 and back to 5 but with the online IDE there are no issues and the sketch uploads just fine.

I found a bunch of solutions on this forum, like double pressing the reset button, trying different USB cables, trying different USB ports, running the IDE as admin, etc... but nothing seems to work. Any help will be greatly appreciated!

The swapping of COM ports is fully expected and normal behaviour for these boards.

Did you try quickly double tapping the RESET button to put the board in BOOTLOADER mode and then selecting that COM port for your upload ?

Also moving you to the correct section.

Bob.

Thanks Bob. Yes, now I see that the COM swapping happens when in the online IDE with logic to swap it, upload the sketch, and wait until the original reappears. So, it seems like that is where the problem is when running on my local machine. It never re-acquires the original port. The port is there in the menus and I can manually select it but when I try to upload again, the COM port switches again (usually back and forth between COM4 and 5).

Yes, I tried the double tap on the reset button. I'd seen that elsewhere on these forums. It goes into bootloader mode or whatever it is called, where the onboard LED is fading in and out, and I can try the upload again but I still have the same issues.

If everything works with the online IDE it seems like it has to be something with the locally installed Arduino IDE? I'm using the same USB cable, USB port, code, etc. online and it works. Could there possibly be something different in the way the online plugin deals with the COM ports vs the way the local IDE software does?

Whilst very similar both IDE's do differ quite a lot in some key areas.

Most common issues with local USB can sometimes be just that LOCAL to the computer.
USB 3.0 has been seen to cause issues when used directly but that is not always the case where some form of relay (create in simplified terms) is used.

Other pointers for local USB are :-

Borderline good USB cables.
Energy saving settings.
Antivirus or similar settings.
Network / cloud based usage of the regular IDE.

The last two can be a real pain for the proper IDE.
So if you can rule those out.

Bob.

I have a new USB cable on order so will test that when it arrives.

Is there a particular energy saving setting? I tried disabling the "USB selective suspend setting" as it was the only obvious USB-related one, but to no avail.

Setting antivirus off makes no difference. Can you give an example of "similar settings" might there be that I could try?

Nor sure what you mean by "Network / cloud based usage of the regular IDE." Is that like running the app or loading files off of a local network drive? I'm running it off my C drive but to load the ino files from a network drive...

Thanks!

Better to move your sketches back to a local drive rather than network drive unless you understand and can set it up properly.

Depending on the Antivirus brand some do not fully turn off and it has been found in the past that sometimes you need to add Arduino locations to the exclusions / white list to be able to get past those aspects.

Another thing to watch out for and more so with win 10 is to try AVOID any driver updates from Microsoft.
Always get the latest drivers directly from the hardware site involved especially USB and GRAPHICS drivers.
If your specific hardware says its driver is from MS then roll them back to the manufacturer. Then go get the real ones.

Sometimes it is the oddest thing that fixes issues. Some of these suggestions come from being on here and from having been a computer technician.

Bob.

I tried moving them to the local drive and no difference.

Antivirus temporarily "off off" as in totally uninstalled and no difference.

On the drivers, not sure I understand... do you mean to "right click > Properties" on the items under "Device Manager > Universal Serial Bus controllers" and check the Driver tab's "Driver Provider" value and if it is "Microsoft" to go find drivers made by whoever created the physical USB hardware and install those instead?

Still keep your sketches LOCAL as you have now done as it may prevent issues further down the line.

Understood on the AV.

Yes if it says MS was the provider then go get the REAL drivers from the hardware manufacturer or simply roll them back to the original as a quick but not totally foolproof method of testing.

Bob.

PS adding an IDE re-install PDF which has some locations you can add to your AV or other security.

CLEAN UP BEFORE INSTALLING ANOTHER COPY OF THE IDE OR ARDUINO CREATE.pdf (347 KB)