USB port not working after opening serial monitor

Hi, this week my first Arduino, a NANO 33 IoT, arrived and since then I played around with some sketches. However, I experience issues whilst uploading new scripts. As far as I can tell, it's related to the serial monitor. Every time I open the serial monitor I won't be able to upload new sketches on the same USB port afterwards. I always get the following error message:

Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Apr 19 2019 14:38:48
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] Apr 19 2019 14:38:48
SAM-BA operation failed
Version      : v2.0 [Arduino:XYZ] Apr 19 2019 14:38:48
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
An error occurred while uploading the sketch
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.839 seconds

Write 51388 bytes to flash (803 pages)
write(addr=0x20005000,size=0x1000)

After that the orange LED on my Arduino starts fading and if I try to upload again I get the following error message:

No device found on cu.usbmodem142301
Set binary mode
readWord(addr=0)=0x20007ffc
Send auto-baud
Set binary mode
An error occurred while uploading the sketch

After enabling boot loader mode (double pressing the reset button) the error changes to this one:

Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Apr 19 2019 14:38:48
chipId=0x10010005
Connected at 921600 baud
SAM-BA operation failed
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
An error occurred while uploading the sketch

The only solution I currently figured out is switching to another USB port or if all ports were in use restart the computer.
I'm using macOS Catalina with the Arduino IDE v1.8.16.

Any help is appreciated :slight_smile:

Port cannot be used for uploading and serial monitor at the same time.
Just try to close serial monitor and the uploading should work. After uploading you can open serial monitor again.

Seems like I forgot to mention it in the post. I did close the monitor before uploading. Could it be that the IDE still "talks" with the board on the port via the serial connection? However, I read that all the communication should be stopped once the board is unplugged...

Not strictly true as the sketch will restart when the board is plugged back into a USB port.
We have a section for the newer NANO's and I will move your topic there.
Much more information can be found in that section and I suggest you read the pinned posts at the top of that section.

Dunno if I'm blind but I just see one pinned post called About the Nano 33 IoT with a link to the Arduino store. Am I missing something?

My bad or it was removed at some point.
Check the other newer nano sections too for pinned items but you are at least now in the correct section.

So you think it’s an issue with the board and not with the software?

Not necessarily the board but it how it may be being used.
I just plugged in a 33IOT and set it up to do some serial work and so far no issues.

Include your sketch in your next post but take a quick read of the stuff below before you do that please.

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.

I just used the example sketches, but in my experience the sketch itself has no effect. For example uploading the ArduinoBLE LED peripheral example worked like a charm, but after opening and closing the serial monitor as well as uploading the blink sketch I would get the above errors. So I thought the issue is related to the IDE – hence the original category I chose.