Why are the MKR series USB ports so unreliable?

I’ve been using the MKR series for some time now, and constantly struggle with keeping the USB COM port reliable on the series of MKR products. It seems that the COM port is fine for a while, then it gets in a huff and usually requires one of the following to get it working again:

A) Uninstall both upload and normal COM ports for the board
B) Double click usually brings back the upload port but not the debug port
C) plug the MKR board into a different USB port (sometimes works)
D) Move the port to a different COM number
E) reboot the computer and try all of the above over and over until it works >:(

When this happens, the port is selectable from the drop down list and can be seen in hardware manager, but trying to open serial monitor in Arduino IDE reports:

Error opening serial port ‘COM2’. (Port not found)

and uploading code reports:

processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2075)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port 'COM2'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - COM2; Method name - openPort(); Exception type - Port not found.
	at jssc.SerialPort.openPort(SerialPort.java:167)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

This is different from the port missing message when the device is physically unplugged, so you can see the port in the drop down list, it just can’t seem to open it.

I actually find OTA updates more reliable than using the USB port, but of course serial debugging to the monitor is not as easy!

The MKR and a few other boards have DUAL COM ports.

One is the regular one and the other is the BOOTLOADER.
During programming it would be normal to see it swap those ports then swap back.

Quickly double pressing the reset button will hold it in the BOOTLOADER mode which is useful in case your sketch is not quite perfect.

Putting a general list below some of which may be useful now or in the near future.
Note the USB and Antivirus one.

Please READ THIS POST to help you get the best out of the forum.

SIMPLE TROUBLESHOOTING.
These steps may also save you some unnecessary time and effort in the forum.

  • Always provide as much detail as possible to your issue it may be important.

  • If applicable provide your SKETCH inside CODE TAGS ( </> ) or a CREATE share link.

  • If applicable provide a schematic even if hand drawn.

  • How to insert a picture into your post

  • If applicable provide a proper LINK to the hardware / sensors etc. you are using.
    COMMON ISSUES

  • Check you have a COMMON GROUND where required.

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102

  • There may be a problem with the board check your wiring first.

  • Remove any items connected to pins 0 and 1.
    COMPUTER RELATED

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE’s as ADMINISTRATOR or your OS equivalent
    Performing the above actions may help resolve your problem without further help.

Bob.

Just replying to this post. I am (and many others) experiencing the same issue.
I think I am starting to regret purchasing these MKR1010 modules. Indeed, basic functionality is not reliable. I havent found any form statement from the Arduino organisation about recognising the problem and working on a fools proof solution.

Regards

I just purchased a MKR1010 and have yet to get my Windows 7 Pro 64 bit system to be able to upload a sketch to it. I'm having no other issues with any of my other Arduinos (Uno, Mega, Mini, Micro, etc). I'm attempting to upload the simple Blink sketch and keep getting the infamous "An error occurred while uploading the sketch." The IDE recognizes the board and properly identifies it as a MKR1010. I am using IDE Version 1.8.10. I have reset the board by double clicking the reset so that the on board LED "breaths" and still no joy. Here is the error message:

Forcing reset using 1200bps open/close on port COM26
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
PORTS {COM13, COM26, } / {COM13, COM26, } => {}
Uploading using selected port: COM26
C:\Users\BigDog4\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM26 -U true -i -e -w -v C:\Users\BigDog4\AppData\Local\Temp\arduino_build_355435/Blink.ino.bin -R
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Mar 19 2018 09:45:14
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID : 10010005
version()=v2.0 [Arduino:XYZ] Mar 19 2018 09:45:14
Version : v2.0 [Arduino:XYZ] Mar 19 2018 09:45:14
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security : false
Boot Flash : true
readWord(addr=0x40000834)=0x7000a
BOD : true
readWord(addr=0x40000834)=0x7000a
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.605 seconds

Write 12260 bytes to flash (192 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

SAM-BA operation failed
An error occurred while uploading the sketch

[========== ] 33% (64/192 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[==================== ] 66% (128/192 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x1000)

[==============================] 100% (192/192 pages)
done in 0.071 seconds

Verify 12260 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 15c4
checksumBuffer(start_addr=0x3000, size=0x1000) = 5276
checksumBuffer(start_addr=0x4000, size=0xfe4) = df53
Verify successful
done in 0.016 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

I can't wait to get this IOT board going. I'm sure I have over looked something simple but I can't seem to determine ehat it is. Any ideas? Thanks in advance for the help! I'll be happy to post more info if needed.

There have been multiple reports about 1.8.10 and various issues.
I would suggest roll back to 1.8.9 for now to see if that alleviates the issue.

Extra clean up instructions also attached.

Bob.

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

I will give it a try. Thanks for the help Bob!

You might consider migrating to the uf2 bootloader. UF2 mounts a drive on your desktop when you double tap the reset button to enter bootloader mode. Then you can simply drag and drop a file from your computer onto the drive to flash the device.

It is a complicated process to change the bootloader, but I find it is quite convenient after you have done so.

This won't solve com port problems but does lend itself to more convenient flashing.

@Kadams58 I had this error on my W7 machine as well, yet the sketch always uploaded correctly. Something to do with the reset process, switching the port from bootloader to normal after flashing and IDE not seeing the correct port or something. Same thing happened when adding a new IoT board to device manager, took ages to have a successful crypto chip configuration attempt.

I'm on a W10 machine now and everything works fine.

Judging by the output you printed, are you sure the sketch isn't uploaded correctly and running as it should?